1. hibernate - createCriteria or createAlias? stackoverflow.comIf I want to search those students who take class "Math" and "John" is his group: shoud I use createCriteria or createAlias?
|
2. hibernate createCriteria stackoverflow.comFrom Hibernate source, in Criteria.class, we have:
What is 'kittens' here? The name of a column? ... |
3. How do I write nested AND and OR blocks in a hibernate criteria with grails createCriteria stackoverflow.comI tried to write the following SQL-Statement as a criteria:
|
4. hibernate createCriteria issue coderanch.comI have two tables mapped using hibernate (jobApplication, jobApplicationComments). The jobApplication object has the following details... |
5. createCriteria problem forum.hibernate.orgHi ... I am new to hibernate.... here my problem Student{ Long sid; // primery key String sname; Address address; } Address{ Long addId; String street; String City; } I am passing Student to create Criteria ... in o/p have to get all student records city is bangalore Criteria crit = session.createCriteria(Student.class); crit.add(Restrictions.eq("address.street","bangalore"); not working.... the error is org.hibernate.QueryException: could not ... |
6. createAlias/createCriteria with additional restriction forum.hibernate.orgHi everbody Using Hibernate 3 with XML mappings. Say, there is a "Project" object referencing "Information" objects like |
7. Problems with Criteria.createCriteria & Criteria.createA forum.hibernate.orgSenior Joined: Sun Aug 31, 2003 3:14 pm Posts: 151 Location: Earth (at the moment) What is wrong with my code for nesting Criterias? I first tried with the commented out lines and then I added the createAlias version and both generate the same type of error: Quote: net.sf.hibernate.QueryException: could not resolve property: prod.costFactors [null] Code: ... |
8. createCriteria not cacheable? forum.hibernate.orgHello ! I am currently experimenting with hibernate for the first time. We do have a self programmed persistence layer which maybe should be replace in the future. One of the goodies with our layer is the possibility to programmatically create select/update/insert statements for the database (for sure, for some databases). Much like your Criteria API. To come to the point: ... |
9. Bug in createCriteria or createAlias? forum.hibernate.orgHi, I use criteria api createCriteria or createAlias to make association between classes. I find there is bug in the formed sql which does not have the referenced class in the from clause when the reference is part of composite-id (that is, it is key-many-to-one). If the reference is NOT part of composite-id (that is, it is man-to-one), the from clause ... |
10. (HN3) Example.createCriteria not working with one to many forum.hibernate.orgHi . Having a problem with createCriteria. My Hibernate connection and sessions are ok. The only problem is hat I cannot use Example.createCriteria and get an error that: could not execute query. I have also tried to type the SQL code between quotes and results in the same error. Any help will be appreciated. This is my little java code: Code: ... |
11. when to use HQL, when to use createCriteria? Pros & Cons forum.hibernate.orgThey are both good. I would say it is up to your preferences. Criteria API works well in different kind of generic criteria builders. Because it is hierarchical by nature. Actualy, HQL builders can be built as well almost with the same effort. HQL is good when you have to create something more or less sophisticated and it is more clear ... |
12. "createCriteria" and traveling back the associati forum.hibernate.org |
13. createCriteria outside container - 0 results forum.hibernate.org |
14. nested createCriteria results in bad SQL - HB 3.1 forum.hibernate.orgHi There, Have a nested createCriteria that results in bad SQL which results in a column ambigiously defined error from Oracle. DetachedCriteria criteria = DetachedCriteria.forClass(A.class); criteria.createCriteria("B"). createCriteria("C").add(Restrictions.in("type", mpTypeList ) ) ; select count(*) as y0_ from A this_, B event1_, C monitoredp2_, C monitoredp2_ where this_.ID=event1_.ALARM_ID...... Notice the duplication is red font above i.e. it generates C monitoredp2_ twice. I think ... |
15. createCriteria question forum.hibernate.orgHello, What I am trying to do is select 2 fields from a table that has 8 fields. Using the createQuery this is easy session.createQuery("Select lname,fname from Person"); I get back an object and then I can select last name and first name using the first and second array This is great because it creates a query for me that only ... |
16. hibernate createCriteria issue forum.hibernate.orgChanged to.... Criteria crit = session.createCriteria(JobApplication.class) //.setFetchMode("jobApplicationComments", FetchMode.JOIN) .createAlias("jobApplicationComments","comments") .add(Expression.or(Expression.like("firstName", "%"+name+"%").ignoreCase(),Expression.like("lastName", "%"+name+"%").ignoreCase())) .addOrder(Order.desc("createdDate")); Getting the following error.... ERROR org.hibernate.LazyInitializationException - failed to lazily initialize a collection of role: com.haysmed.jobapplication.hibernate.JobApplication.jobApplicationComments - no session or session was closed org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.haysmed.jobapplication.hibernate.JobApplication.jobApplicationComments - no session or session was closed |
17. How to use Hibernate createCriteria() forum.hibernate.orgI have two tables: Project and Study. Their relationship is many-to-one. I want to write the following query: select * from Project project inner join Study study on project.study_id = study.study_id and project.name = projectname and study.name = studyname; The code I wrote for the query is: Criteria crit = session.createCriteria(Project.class); crit.add(Restrictions.eq("name", "B2")); // set restriction on project's name crit.createCriteria(study).add(Restrictions.eq("name", "S2")); ... |
18. How to 'OR' two criteria created by createCriteria forum.hibernate.orgGood day. Someone has post a similar question, but I can't find a working solution so far. Could anyone please have a look , you are forum hero if you can solve it. Basically I need 'or' two criteria. The scenario is that : we got a TXN, if the TXN is for stock , then TXN.stockLegs will be a non ... |
19. ClassCastException Using createCriteria forum.hibernate.org |
20. createCriteria help forum.hibernate.org |
21. CreateCriteria whith many items forum.hibernate.orgCriteria criteria = session.createCriteria(Device.class); for (Iterator iter = lstCriteria.iterator(); iter.hasNext();) { MyCriteria myCriteria = (MyCriteria) iter.next(); criteria.createCriteria("records").add( Expression.and( Expression.eq("key", myCriteria.getKey()), Expression.eq("value", myCriteria.getValue()) ) ); ... |
22. What is the difference between createCriteria and createAlia forum.hibernate.org |