[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

HQL statments

Posted on 2009-04-18
5
Medium Priority
?
329 Views
Last Modified: 2012-05-06
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
0
Comment
Question by:haileysdad
  • 3
5 Comments
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 24174746
Sounds like you'll just need to use the SELECT and INSERT queries. See here,
http://code.google.com/p/hypertable/wiki/HQLTutorial
0
 

Author Comment

by:haileysdad
ID: 24176857
yes, but I am not trying to build hypertables.  I am attempting to create Java code using Hibernate support
0
 
LVL 92

Accepted Solution

by:
objects earned 750 total points
ID: 24177279
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
 

Author Comment

by:haileysdad
ID: 24181119
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
 

Author Closing Comment

by:haileysdad
ID: 31571744
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
How much do you know about the future of data centers? If you're like 50% of organizations, then it's probably not enough. Read on to get up to speed on this emerging field.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question