HQL statments

I have already added the 'search' queries that I need.  Now I am trying to add functionality that will allow me to add entries.  The entries are to go along with the buttons I have in the screen shot that I will post.  They are to be for things such as adding a student or adding a course.  Does anyone know the standard HQL statments that I should use?
HQLhelpscreenshot.jpg
haileysdadAsked:
Who is Participating?
 
objectsCommented:
if you using hibernate then you don't need to use hql to sdo an insert, instead map your classes to your database tables

0
 
InteractiveMindCommented:
Sounds like you'll just need to use the SELECT and INSERT queries. See here,
http://code.google.com/p/hypertable/wiki/HQLTutorial
0
 
haileysdadAuthor Commented:
yes, but I am not trying to build hypertables.  I am attempting to create Java code using Hibernate support
0
 
haileysdadAuthor Commented:
I figured out that it would work by using the set methods that were created with Hibernate and the file Mapping wizard.  Using something similar to this:

            Session session = HibernateUtil.getSessionFactory().openSession();
            session.beginTransaction();
            Student student = new Student();
            student.setStudentId(studentIDTextField.getText());
            student.setFirstName(firstNameTextField.getText());
            student.setLastName(lastNameTextField.getText());
            student.setGender(genderTextField.getText());
            student.setDegreeProgram(degreeTextField.getText());
            session.saveOrUpdate(student);
            session.getTransaction().commit();

Open in new window

0
 
haileysdadAuthor Commented:
This answer was at least on topic.  I figured out the true answer before seeing this one.  Objects is a good user who has solved some of my other problems before.  He or she is definitely one of the top Java experts.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.