In the second part of our series on Hibernate, we will take a close look at its architecture and core classes. We will also cover the different types of queries possible in Hibernate. Finally, we'll use a real world example to illustrate our discussion.
The main difference between HQL and QBC is clearly visible from the above codes. The HQL works just like SQL. But when QBC is used, the developer is working in a completely object oriented environment. Below is the code using QBE:
import java.util.List;
//other imports
// use as
// java test. FindOrderById name
public class FindOrderById {
public static void main(String[] args) throws Exception {
That ends this discussion of the architecture of Hibernate and the categories of the Queries. Now that the architecture is clear we can move on to more complex topics. In the next part I will discuss the life cycle of a persistent object and associations, as object life cycle becomes very important when working with associations. So, till next time.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.