1. HQL: order by property of nullable property stackoverflow.comAssuming two tables, |
2. How to add a Hibernate property that's really a query stackoverflow.comWe're using Hibernate to load objects that meet certain criteria. If the user decides to view the details on one of the objects, I want to pull up some additional ... |
3. Hibernate criteria query on different properties of different objects stackoverflow.comSuppose I have classes like:
and I want to filter criteria on A, two filters on different subclass ... |
4. Hibernate Criteria / Query on object properties stackoverflow.comI have a class
I also have another class Student ;
|
5. Order by nullable property simultaneously with ordering by not nullable property in HQL stackoverflow.comI have a table called Users in my database. Let's assume that User has only 3 properties int ID; string? Name; string Login; If user doesn't specify his name then Login is displayed. Otherwise Name ... |
6. How to make query on a property from a joined table in Hibernate using Criteria stackoverflow.comI have the following mapping:
|
7. HQL specify an order by property order? stackoverflow.comHow can I order by a specific property order in HQL?
For MySQL I can use: |
8. Collection property and Projections of Criteria API (Hibernate) stackoverflow.comI have two entities that relate to each other as "many-to-one". So one type of the entity has a collection of child entities of another type. Is it possible to retrieve ... |
9. How to sum two properties in a hibernate query stackoverflow.comHow do you do this in hibernate criteria API, select schedule.* from schedule inner join route on route.routeId=schedule.routeId where schedule.scheduledFor >=1292198400 and (route.plannedArrivalTime + schedule.scheduledFor) <= (1292198400 + 86399); I could not understand ... |
10. Hibernate projection on many-to-many property stackoverflow.comI'm using Hibernate 3.3.2. I have class A, which has a property b, which maps a many-to-many relation to B. Class A has the following mapping:
|
11. How using a derived property in HQL where clause stackoverflow.comi have an entity like this:
|
12. JPA2 (Hibernate) how to query 2 tables (joined) but only need certains properties from 2nd table stackoverflow.comI am using JPA2 with hibernate as provider in java ee6 environment. I have a one to many relationship and when getting all the rows for the one side to display ... |
13. Criteria query and |
14. Selecting a Collection Property in HQL causes SQLException forum.hibernate.orgHello, I'm having trouble selecting a collection property in HQL. I wrote a special Object which should be created by hibernate and be filled with several properties of the queried entity. This does not work if any of the properties I select is a collection. In the resulting SQL-Query Hibernate will include a dot without any name before or after it ... |
15. PostgreSQLDialect can't handle order property forum.hibernate.org |
16. HQL specify an order by property order? forum.hibernate.org |
17. Simply HQL query, could not resolve property forum.hibernate.orgclass ClassA{ @Id private long id; @ManyToOne(cascade = CascadeType.ALL) private ClassB classb; getters(); setters(); } class ClassB{ @Id private long id; private String name; ... |
18. How to use HQL query as a property? forum.hibernate.org |
19. Order property causes table not to get created, but no error forum.hibernate.orgI hope I'm posting to the right section. I did a quick search and didn't found mentions of the problem I'm reporting. If this is a known issues and/or has been resolved in a more recent version, please ignore this. I just found out that if an object has a property "order", the table does not get created when Hibernate generates ... |
20. Projection on properties of one table only forum.hibernate.orgHello, Here is my Criteria based multi join query. It works fine, except that I would like it to return only the mail properties and not the admin ones. I guess I need some projections to do that... Code: public List |
21. How to order a collection property ? forum.hibernate.orgPro Joined: Mon Apr 16, 2007 8:10 am Posts: 213 I have a property that is a collection. I mapped it so as to order it by the listOrder index, like: Code: |
22. Select properties query forum.hibernate.orgHi, I face an issue with my query with some of the properties been specified in the query. Eg: My query looks like, SELECT student.firstName, student.lastName, student.rollNo FROM Student AS student I assume, this query returns a list of Student with values been set to the properties specified in the query and all other properties to null reference. But the result ... |
23. HQL queries with property names forum.hibernate.org |
24. query with "special" class property forum.hibernate.org |
25. Get property NAMES when using Query.Scroll forum.hibernate.orgFor the moment, I have the following code : sql = "SELECT i.companyCode, i.fundSponsor FROM abpro.beans.Funds2 i WHERE i.fundCode = 'B91A' AND i.classCode = 'A'"; // create an HQL statement and execute hql = session.createQuery(sql); results = hql.scroll(); results.beforeFirst(); while(results.next()) { System.out.println(results.get(0) + " - " + results.get(1)); } With this code, I get the VALUE of the properties. But how ... |
26. Querying for one object using a owned object's properties forum.hibernate.orgI have a user object with properties stored in the userex table (first, last, user names, id). I also have a join table to the jobs table (a many-to-many user to jobs). The jobs table contains employer and city fields along with an id. This is a basic many-to-many realtional database setup. I have mapped user to jobs successfully and queried ... |
27. How to set a collection count without new property forum.hibernate.orgAuthor Message adcworks Post subject: How to set a collection count without new property Posted: Tue Jul 13, 2004 10:25 am Senior Joined: Fri Jun 18, 2004 10:17 am Posts: 140 I have a situation where I load a list of Schedule objects and each Schedule contains a Set of ScheduleUpdate objects. On my list page I only ever ... |
28. How to find column name from a property? forum.hibernate.orgI want to know how to find column name from a property at runtime? for example: |
29. I want to know how to find column name from a property? forum.hibernate.orgI want to know how to find column name from a property at runtime? for example: ? |
30. Selectively updating properties forum.hibernate.orgHibernate version: 2.1.6 Mapping documents: Code: |
31. Can't find hibernate.properties in a JARed application forum.hibernate.orgpublic static void main( String[] args ) { // extract hibernate.properties location from path if ( args.length < 1 ) { System.out.println( "Please specify the hibernate property file" ); return; ... |
32. problem with derived property in criteria query forum.hibernate.orgjava.lang.NullPointerException at org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:68) at org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:33) at org.hibernate.persister.entity.BasicEntityPersister.toColumns(BasicEntityPersister.java:1104) at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:402) at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumnsUsingProjection(CriteriaQueryTranslator.java:368) at org.hibernate.criterion.SimpleExpression.toSqlString(SimpleExpression.java:42) at org.hibernate.loader.criteria.CriteriaQueryTranslator.getWhereCondition(CriteriaQueryTranslator.java:313) at org.hibernate.loader.criteria.CriteriaLoader. |
33. Query is assuming a method as a property forum.hibernate.orgHibernate version: 2.17 I have 2 classes: Task and Group (TASK and GROUP tables respectively). There is one-to-many association from Task to Group. public class Task implements Serializable { private taskId Integer; ... public Integer getTaskId() { return taskId; } private void setTaskId(Integer taskId) { this.taskId = taskId; } ... } public class Group implements Serializable { private groupId Integer; private ... |
34. Can't select byte[] property after migrating to Hibernate3 forum.hibernate.orgAfter migrating to Hibernate3, the following query can't be executed. |
35. Subqueries.in VS Property.forname().in forum.hibernate.orgNot sure if this is related, but I keep getting there classcastexceptions for just about anything now. Mapping: |
36. how to include all class properties in a report query forum.hibernate.orgI want to create a report query, but I need to get properties defined for the class I am quering. Is there a method I can call that call create a select statement that would give me the select done for all class properties - e.g select A.prop1, A.prop2, A.prop3, A.pro4 from A ? |
37. Order by sub property forum.hibernate.orgpublic class Item { protected Integer itemId; protected State state; //getters and setters } public class State { protected Integer stateId; protected String name; protected String description; protected Integer naturalOrder; ... |
38. How to use Criteria query on "class" property forum.hibernate.orgHow do I to use Criteria query on "class" property with custom discriminator-values? I've tried to find this from the docs, forums and google but found no clear answer. I tried various ways but none works: Code: s.createCriteria( Person.class ) .add( Restrictions.eq( "class", ... |
39. HQL query with select new on class and also property forum.hibernate.orgI am not sure whether this is possible to do. I have an HQL query this does "select distinct c from Class1 c, Class2 d where c.column1 = d.column2". That works fine, but now I have a property on Class1 that is not persisted in the database, however, when I do the same HQL query, I want to populate the value ... |
40. Use properties instead of columns in collection order-by?? forum.hibernate.orgThanks for your reply. I am aware of some of the options for sorting in Java. But doesn't that mean you have create a Comparator class for each collection you want to sort? Either way, it seems many people would want to do the ordering on the DB side. So why the SLQ-centric mapping for order-by? We've gone through the great ... |
41. Accessing "virtual" properties in a select stateme forum.hibernate.orgHello. I have the following problem: in a SQL Statement "SELECT ..., 1 AS userCompanyID FROM Companies" i want to access the "virtual" Property userCompanyID and its value 1. "userCompanyID" doesnt exist as a column in my Companies-Table and should be readable from my Dataobject CompanyData (which is mapped to the Companies-Table) Hibernate argues that the column of my virtual property ... |
42. Select ignoring any property forum.hibernate.orgAuthor Message nicfournier Post subject: Select ignoring any property Posted: Thu Sep 01, 2005 4:01 pm Newbie Joined: Thu Jan 06, 2005 4:41 pm Posts: 8 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: Hibernate 3.0.5 I just migrated to hibernate3 and one of my HQL query does not work anymore. To give some background ... |
43. selecting a collection property using criteria queries forum.hibernate.org |
44. Removing properties from select forum.hibernate.orgI have got an object which contains some complicated derived fields, based on values on other tables etc. I am worried about the performance implications of this since the derived queries always appear in the select clause of the sql if I use the criteria api. Is there a way of preventing this, ie only select a limited number of values ... |
45. Excption with order by : could not resolve property forum.hibernate.orgWe select objects of type EvaluationFunction and up till now we only ordered these objects on columns proper to this table. Now a new requirement entered and the elements of the Evaluationfunction table must be ordered by a field of a foreign key field. Obviously this did not work too well. We added code bit in case if refers to a ... |
46. can i use hql find a part of property from class??? forum.hibernate.org |
47. How to access class properties in select w/ several classes forum.hibernate.orgHibernate version: 3.0 Hello everyone. I have a doubt. I have the following SQL: Code: Query select = session.createQuery("from OrdemItens oi," + ... |
48. Wrapping selected object properties and ... forum.hibernate.orgI need to point it out that the HQL in this thread only let Hibernate issue a single SQL statement and fetch data from the Book table only. A join statement is needed in order to fetch data from the Review table as well along with its parent object. This is an information from the reference documentation. |
49. Can I use a property of a CompositeUserType in an ORDER BY? forum.hibernate.orgAuthor Message kjohnston Post subject: Can I use a property of a CompositeUserType in an ORDER BY? Posted: Wed Dec 14, 2005 5:30 pm Newbie Joined: Wed Dec 14, 2005 4:20 pm Posts: 2 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Can I use a property of a CompositeUserType in an ORDER BY? I am seeing ... |
50. Problem with Projections.property and CompositeUserType forum.hibernate.orgHi Ivan, I solved the problem this way: Code: try { final Criteria criteria = HibernateUtil.getSession().createCriteria(IContract.class); ProjectionList projections = Projections.projectionList(); projections.add(Projections.property("value.value")); projections.add(Projections.property("value.currency")); ... |
51. HQL - selecting parent of a collection with common property forum.hibernate.org |
52. Order.asc() and Order.desc() fail to process sub-properties forum.hibernate.org |
53. FK is PK: Unable to find properties forum.hibernate.orgUnable to find properties (contractnr, producttypenr) in entity annotated with @IdClass:nl.reinders.bm.Producttype2Contract I assume this exception tries to tell me it can't find the properties in the Producttype2ContractPK class specified in nl.reinders.bm.Producttype2Contract. So I tried to resolved that, but now am stuck. There basically is a N-M relation between Producttype and Contract. However, the N-M relation "Producttype2Contract" itself contains some attributes, so ... |
54. Using criteria query with collection properties forum.hibernate.org |
55. Querying for an object based on a property in a set... forum.hibernate.orgclass link { private Integer id; private Set uids = new HashSet(); // set of uidclass // ctor snipped // plain jane getter and setters snipped } class uidclass { private String uid; private boolean someprop1; private boolean someprop2; // ctor and plain jane ... |
56. query referencing a property which is not explicitly joined forum.hibernate.orgHello, sorry if that is obvious to more experienced Hibernate users: i want to achieve ordering on the following query: select day.items from Day as day where (year(day.day) = ? and month(day.day) = ?) order by day.day asc, item.hour asc ---------------- the day.items is a Map |
57. could not resolve property: in Criteria Query (joined Table) forum.hibernate.orgHello, i have a problem with searches in embedded(joined) Objects(tables). Following Query works in Hibernate Console: select abw.dbKey, abw.auftrag.kunde.kundenName from de.test.pps.VoAbweichung abw where abw.auftrag.kunde.kundenName like 'xyz%' If i make the same in a Criteria Query, i get the errormessage org.hibernate.QueryException: could not resolve property: auftrag.kunde.kundenName of: de.test.pps.VoAbweichung Hibernate version: hibernate 3.0.5 Mapping documents: |