`
- 浏览:
54297 次
- 性别:
- 来自:
湖北武汉
-
Using the Hibernate API directly in DAO implementations
java 代码
- public class ProductDaoImpl extends HibernateDaoSupport implements ProductDao {
-
- public Collection loadProductsByCategory(String category) throws MyException {
- Session session = getSession(getSessionFactory(), false);
- try {
- List result = session.find(
- "from test.Product product where product.category=?",
- category, Hibernate.STRING);
- if (result == null) {
- throw new MyException("invalid search result");
- }
- return result;
- }
- catch (HibernateException ex) {
- throw convertHibernateAccessException(ex);
- }
- }
- }
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
Learn the business and technical importance of API design and architecture using the available cloud services from Azure and AWS. This book starts off with an introduction to APIs and the concept ...
It provides detailed information necessary for implementing the PowerPC architecture in various systems while also outlining the limitations and responsibilities associated with using the document ...
This is a starter guide for those who want to quickly understand the basics of Web API. Topics covered in this book are: Implementing Web API Web API Client Implementations – ASP.NET MVC and jQuery...
Although the GSS-API enables applications control over security aspects, a programmer using GSS-API can write a program that is ignorant of the details of protecting network data. Therefore, a ...
Stephen Rago's update is a long overdue benefit to the community of professionals using the versatile family of UNIX and UNIX-like operating environments. It removes obsolescence and includes newer ...
During the 1980s and early 1990s there was significant work in the design and implementation of hardware neurocomputers. Nevertheless, most of these efforts may be judged to have been unsuccessful: at...
From there, the book explores the core and contributed landscape for decoupled Drupal, authentication mechanisms, and the surrounding tooling ecosystem before delving into consumer implementations in ...
Provides algorithms covered in three parts, the mathematical development of the algorithm using a simple example, the code implementation, and then numerical examples using the code Allows readers to ...
The Java Development Kit (JDK) APIs are specific to the JDK and will not necessarily be available in all implementations of the Java SE Platform. These APIs are in modules whose names start with jdk. ...
The JavaFX runtime does the following, in order, whenever an application is launched: Constructs an instance of the specified Application class Calls the init() method Calls the start(javafx.stage....
Necaise introduces the basic array structure and explores the fundamentals of implementing and using multi-dimensional arrays. The underlying mechanisms of many of Python’s built-in data structures ...
The API (application programming interface) reference sections in each chapter, which describe the relevant parts of each class, have been replaced with (i) a summary section that lists the classes ...
javax.activation The JavaBeans(TM) Activation Framework is used by the JavaMail(TM) API to manage MIME data. javax.annotation javax.annotation.security javax.ejb The javax.ejb package contains the ...