query 2 « Query « JPA Q&A





1. Hibernate Query: using not in    forum.hibernate.org

2. Querying    forum.hibernate.org

3. querying again    forum.hibernate.org

Hello, I'm trying to use Hibernate with oracle. I want to do a query like this Select from products as p where Month(p.date) = xx but it doesn't work. This query: select products.date from Products as product is OK, but answer a list of timestamp's (example 2003-12-11 00:00:00.0) and I don't know what I have to do, can something help me ...

4. queries and compilation    forum.hibernate.org

Hi all, I've recently started using Hibernate, and have been loving it. It just helps so much! One problem that I have had with it is the queries - the queries are strings, which don't get compiled. It would be nice to be able to have the queries compiled to have them checked for validaty. In particular, I would like to ...

5. queries and compilation    forum.hibernate.org

Hi all, I've recently started using Hibernate, and have been loving it. It just helps so much! One problem that I have had with it is the queries - the queries are strings, which don't get compiled. It would be nice to be able to have the queries compiled to have them checked for validaty. In particular, I would like to ...

6. Query..ummm... query    forum.hibernate.org

Hello all, I'm using MySQL 4.0.17 which doesn't support subselects. Given the following: A.) I have a Users joined-subclass which contains a Set of PartyAttribute objects called partyAttributes that is inherited from its parent object, Party. This is mapped in the mapping file (in the Party declaration) as: Code: ...

7. Is this query possible?    forum.hibernate.org

Hi, I'm new to Hibernate and am wondering if the following query is possible with Hibernate's OQL or HQL: Here is my object model: C-M------1-B-M------1-A | /\ -- | D i.e. A has a 1-M association with B, B has a 1-M association with C and D is one subclass of C The query that I like to perform is this: ...

8. how optimize read only query    forum.hibernate.org

hi all, is there a way to optimize a read only query? i've already define mutable=false in my mapping does query.setLockMode(alias,NONE) or query.setLockMode(alias,READ) optimize the query? If yes, which is the best? I know about cache... but i want to optimize the query, i've optimized the outer join and lazy features thanks to Gavin... but i want to know if there ...

9. Hibernate Query    forum.hibernate.org

Donno if this is a stupid question but wanna clear it off. Does hibernate help only when a query is made? or if i have the O-R mapping configured in xml, and if i use object.functionName(), will i get the value? My problem is....I have to show information from multiple tables into a table format. I make a initial query and ...





10. what's wrong with this query?    forum.hibernate.org

Using 2.1.2 with mysql: Query q = sess.createQuery( "select sum(nf.charges) as charges, sum(nf.claims) as claims, count(*) as files, p.name as name " + "from NativeFormat as nf inner join nf.provider as p " + "where nf.dateCreated > :start and nf.dateCreated < :end " + "group by p.id, p.name"); And the resulting exception. net.sf.hibernate.QueryException: , expected in SELECT [select sum(nf.charges) as charges, ...

11. IndexOutOfBoundsException when querying    forum.hibernate.org

Hi. I'm using Hibernate 1.2.3, Spring framework 1.0.1, MySQL 4.xxx and Tomcat 4.1.27 I've been getting a java.lang.IndexOutOfBoundsException when executing a function inside a DAO. A small part of the DEBUG-trace: 13:10:10,296 DEBUG BatcherImpl:241 - preparing statement 13:10:10,296 DEBUG BooleanType:46 - binding 'false' to parameter: 1 13:10:10,296 DEBUG Cascades:341 - id unsaved-value strategy NULL 13:10:10,296 DEBUG ClassType:46 - binding 'ks.rah.avik2.domain.Function' to ...

12. Weirdness with Query    forum.hibernate.org

13. ont-to-many: how to query one?    forum.hibernate.org

Now there are two classes, for example Parent and Child, as we all know one parent maybe has many children. Parent id (attribute) name (attribute) Child id (attribute) name (attribute) parentID (attribute) age (attribute) If I know the information about name and parentID of a child, how to query the age information about this child? 1. acording to relation of Parent ...

14. Simple query - doable in hibernate?    forum.hibernate.org

Using Hibernate 2 and mysql 4.0.8 I'm going to use an example to show our problem. Let's say we have a box class. The box class has a collection of balls (called balls). The relationship is one-to-many, and is mapped via a Balls_In_Box table: (snippit from box config) So what would the query ...

15. All queries failing with in: expected    forum.hibernate.org

try { Session session = HibernateUtil.currentSession(); Transaction tx = session.beginTransaction(); Iterator iter = session.iterate("from Schedules s"); tx.commit(); ...

16. trouble creating a query    forum.hibernate.org

Hi, I'm having trouble trying to build a query that brings all the objects "A" which have a many-to-one property (holds object "B"), where "B" is not associated to any object "C" (which has a many-to-many Set property of Objects "B"). Class A id many-to-one class="B" class B id ... class C id Set table="CB" many-to-many class="B" In SQL I used ...





17. Query in hibernate    forum.hibernate.org

I'm replacing some beans with hibernate objects and I came across a situation I don't know how to handle. I have the following query: select desc FROM table_A WHERE desc NOT IN (SELECT desc FROM table_b WHERE ID = ? AND JLOCAT = ?) desc is a pk in table_A but not in table_b. There are no foreign keys in either ...

18. Simple Query giving me a headache    forum.hibernate.org

I wish to execute a query where I return all the people that belong to a specific phone number. The names of the people are in a table that is separate from the phone numbers. The HBM files are as follows: Code: protected

19. Query.setTimeout    forum.hibernate.org

We have a need to be able to limit the time taken by various queries, inserts, updates, etc. If the time alotted is exceeded, then the statement will be retried against another datasource. I've spotted the Query.setTimeout method as a potential means of doing this, but I don't believe it will work since it is Statementd bound. Am I correct in ...

20. net.sf.hibernate.Query Interface    forum.hibernate.org

21. Query regarding FlushMode    forum.hibernate.org

Beginner Joined: Tue Jul 20, 2004 1:53 am Posts: 43 Location: India Hi, I am using Hibernate 2.1 with ORACLE 8. I read about FlushMode in "Hibernate In Action" book (from Manning EAP), and thought I understood it. But when I tried out a code sample, it was not working the way I was expecting it to, and it'd be great ...

22. Miscellaneous queries    forum.hibernate.org

23. SQLException - Passing thru Query as SQLQuery?    forum.hibernate.org

7406 [main] ERROR com.li.wedge.test.TestAxis - error trying to load hibernate data for User net.sf.hibernate.QueryException: unexpected token: as [select u from users as u where u.username=:username and u.password=:password] at net.sf.hibernate.hql.FromParser.token(FromParser.java:94) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138) ...

24. Query Works In Linux in once machine not in other machine    forum.hibernate.org

Hibernate version: 2.1.3 Mapping documents:

25. One-to-one and queries    forum.hibernate.org

Beginner Joined: Sun Feb 08, 2004 4:09 pm Posts: 46 Hibernate version: 2.1.6 Mapping documents:

26. Big speed diff b/t MSSQL and the same query in hibernate    forum.hibernate.org

Hibernate version: 2.1.3 Mapping documents: .... some more properties .... ....more properties.... ...

27. Query Interface and UserTypes    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents: Code between sessionFactory.openSession() and session.close(): Query query = session.createQuery("from Test t where t.dateValue > :testDate"); query.setLong("testDate", System.currentTimeMillis()); // Works fine query.setParameter("testDate", new Date()); // Does not work. List results = query.list(); Full stack trace of any exception that occurs: net.sf.hibernate.JDBCException: Could not execute query at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1547) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39) at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:550) at com.bsl.ppmes.database.replication.ReplicationManagerBean.findDestinationTableData(ReplicationManagerBean.java:767) at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source) at ...

28. Query twice    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents:

29. Query / vs model best practice    forum.hibernate.org

In my model, lets say I've got an Order which can contain multiple OrderItems. Further, none of my use cases currently involve the need to retrieve the detail of OrderItems (I.e, there's no direct need to have a getOrderItems on Order). Then, suppose I add some business logic: Lets say, I cant "confirm" and Order unless I have more than two ...

30. [GregorianCalendar]How to do my query?    forum.hibernate.org

31. Simple query not working    forum.hibernate.org

Very weird. I have a table +---------+---------+--------------+ | ITEM_ID | version | name | +---------+---------+--------------+ | 1 | 11 | yyyyyyyyy | | 2 | 0 | another item | +---------+---------+--------------+ When I run the SQL generated by hibernate, I get all the entries, but when I run the simple HQL query of "from NamedItem", I get two namedItems both representing ...

32. Query / Materialization    forum.hibernate.org

33. Query / Materialization    forum.hibernate.org

34. java.lang.RuntimeException: Could not execute query    forum.hibernate.org

Here is my very simple method.... Why do I get this error? Hibernate: select from java.lang.RuntimeException: Could not execute query at gsptech.autopay.biz.EventManager.get(EventManager.java:75) at gsptech.autopay.biz.EventManager.main(EventManager.java:29) Exception in thread "main" private List get() { try { Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction(); List result = session.find("from AWB2"); tx.commit(); session.close(); return result; } catch (HibernateException e) { throw new RuntimeException(e.getMessage()); }

35. lightweight pattern and queries    forum.hibernate.org

I have used lightweight pattern because my table have a large BLOB field. Now i have Normative class with only non BLOB fields and NormativeBody that extends Normative and add a property for the BLOB (String body). Now i want to perform a query to retrieve normatives so NormativaBody normative = ....; ... String bodyToMatch = normative.getBody(); normative.setBody(null); Criteria criteria = ...

36. hierchical queries    forum.hibernate.org

37. Aspect oriented queries using getNamedQuery    forum.hibernate.org

Hibernate version: 2.1.4 I tried something today and just want to submit it to everyone to check if it can be useful. You see, I really like static queries that we define in hibernate using the tag. I tend to avoid dynamic queries unless there is no way I can escape them. But today, a developer need appeared. They need ...

38. Query on a Hierarchy    forum.hibernate.org

Hi, I have a Hierarchy. The super class is A, and child class are A1, A2 and A3. I need get all instances of A1 and A2, but i don't have an interface between A and A1, A2. Any idea ? I make a query with a 2 exists() sentences into where condition, but is very slow for my intention. best ...

39. simple many to many query    forum.hibernate.org

...

40. new() twice in a query    forum.hibernate.org

select new RatedCdrEvent( rce.EvtId, rce.EvtDttm, rce.EvtCount, rce.EvtUsage, rce.StmId, rce.TskId, rce.SflId, rce.VersionId, rce.RceId, rce.RceUniqueKey, rce.RceOriginalANo, rce.RceOriginalBNo, rce.RceOriginalCNo, rce.RceANo, rce.RceBNo, rce.RceCNo, rce.RceInRutId, rce.RceOutRutId, rce.BscId, rce.RceGroupKey, rce.RceExtra1, rce.RceExtra2, rce.RceExtra3, rce.RceExtra4, rce.RceExtra5, rce.RceExtra6, rce.RceExtra7, rce.RceExtra8, rce.RceExtra9, rce.RceExtra10 ), new RatedEvent( rev.EvtId, rev.EvtDttm, rev.EvtCount, rev.EvtUsage, rev.StmId, rev.TskId, rev.SflId, rev.VersionId, rev.RevId, rev.RevCode, rev.RevCount, rev.RevUsage, rev.BipId, rev.BpdId, rev.SvcId, rev.TffId, rev.TabId, rev.BndId, rev.TrnId, rev.RevFromEltId, rev.RevToEltId, rev.RevTrnCount, rev.RevAmt, rev.CurId, rev.RevBilledUsage, ...

41. Querying for UserTypes    forum.hibernate.org

Is there a way to query for UserTypes? I've got an enumerated type implemented as a UserType, and I'd like to be able to select them based on some criteria. The idea is this: The UserType is SecurityRight a User has a Many-to-Many relationship with SecurityRight a User has a Many-to-Many relationship with SecurityGroup a User has a Many-to-Many relationship with ...

42. Query runes about 1 min    forum.hibernate.org

Newbie Joined: Thu Dec 30, 2004 9:49 pm Posts: 4 Hibernate version:2.1.2 Mapping documents:

43. Getting executing query    forum.hibernate.org

Hi, I am running hibernate 2.1.7c and I am having a problem with this executing this query. Here is the sql which runs fine: select z.surrogate_id from zone z, section s, sectiondevicemap map, device d, linecontroller c where z.surrogate_id = s.zone_id and s.surrogate_id = map.section_id and map.device_address = d.address and map.controller_address = c.address and map.protocol = c.protocol_id and d.controller_id = c.surrogate_id ...

44. What is wrong with this query??    forum.hibernate.org

I am trying to execute the following querry and getting a weird exception that I dont understand. Can anyone give me a hand? The query is: Code: select issue from SubscriptionIssue issue where issue.subscription.ID = :subscriptionID and issue.issueNumber > :lastIssue This query says "net.sf.hibernate.QueryException: in expected: issue [select issue from SubscriptionIssue issue where issue.subscription.ID = :subscriptionID and issue.issueNumber > :lastIssue]" The ...

45. Warnings from queries    forum.hibernate.org

Hi, Using: Hibernate 2.1.8 Ms Sql Server 2000 c3p0 connection pool. I am getting this set of messages when I do Hibernate queries. The queries work fine but I would like to track down where these messages are coming from. WARN [main][JDBCExceptionReporter]: SQL Warning: 5701, SQLState: 01000 WARN [main][JDBCExceptionReporter]: [BOS245DA461194]Changed database context to 'pvr'. WARN [main][JDBCExceptionReporter]: SQL Warning: 5703, SQLState: 01000 ...

46. trouble with query    forum.hibernate.org

Hi there, I am having trouble getting a HQL query to render properly to SQL. The query is as follows: from InternalMessage i where i.receiver = :user and hasBeenRead = false ORDER BY i.sender DESC , i.senderGroup DESC This is because in my system, a message can come from a group of users, or from a single user. The following SQL ...

47. doubt with hibernate query langauage    forum.hibernate.org

see i am using the following query with jbpm select involog from org.jbpm.model.log.impl.ExecutionLogImpl exelog , org.jbpm.model.log.impl.InvocationLogImpl involog where exelog.invocationLog=involog.id and involog.serviceMethod='endOfState' and involog.actorId=:user and it is working fine ... but when using jbpmquery=new JbpmQuery( "select involog.actorId,involog.id from org.jbpm.model.log.impl.ExecutionLogImpl exelog , org.jbpm.model.log.impl.InvocationLogImpl involog where exelog.invocationLog=involog.id and involog.serviceMethod='endOfState' and involog.actorId=:user "); i doenot receive corrcet results when i printed the list retrieved it ...

48. Query    forum.hibernate.org

I have the following code : ..... String sql = "from TABLE1 a where a.ban in " + "( select c.ban from TABLE2 c where c.id = :id )"; sess.createQuery(sql).setLong("id", subsId.longValue()).list(); ........ But when I run I get an error in parsing the sql saying an "in" is required. Can you tell me what is wrong with this hibernate query? Mike ...

49. Frustrated - can't get queries to work for some reason    forum.hibernate.org

Hello all. I've had queries working in my hibernate projects before when I used it about 6 months ago. For some reason now I'm always getting the same exception regardless which (of the 2) classes I try to query on now. I'm hoping somebody will have some insight to point me in the right direction. I can successfully load() an object, ...

50. Is this kind of query supported?    forum.hibernate.org

51. Query Metadata    forum.hibernate.org

Hibernate version: 3.0 Hi, I'd like to know if there's a way to access the property name of the returned results for an hql query. For example, for this query : "select client.firstName, client.lastName from Client client", i'd like to obtain metadata information that would give me access to the two property names : "firstName" and "lastName". I found a way ...

52. Query Syantax for findAll Method    forum.hibernate.org

Hibernate version: 2.1.8 To Whom It May Concern, I recently moved from using Jenny from Java Ranch to using Hibernate to handle my object/relational mapping and I must say Hibernate is extremely impressive. I have been using the Hibernate book by Will Iverson to learn from. I have been writting my hbm.xml files by handing and using an ant task to ...

53. 8KB query    forum.hibernate.org

54. Who can write such a query?    forum.hibernate.org

There are two objects Job and Task, one job contains many tasks. task has a property called startTime (Type is Timestamp). Now I want to select the jobs that their earliest tasks (the task contains earliest startTime in each Job) after someday such as 2005-03-24. How do I write the HQL query? Thanks.

55. duplicate queries issued.    forum.hibernate.org

Hi: I have the following hbm.xml file, which defines the relationship between AGENCY and AGENT tables. Code: ...

56. Tablenamequoting in Query not accepted!    forum.hibernate.org

Hibernate version: 3.0 Database version: Postgres 7.4.7 I have a legacy database with special characters as tablenames that have to be quoted in order to be found: Code: Session session = HibernateUtilImport.getSession(); List result = null; try ...

57. probs with query    forum.hibernate.org

58. Wrong query construction : Incorrect Configuration ?    forum.hibernate.org

b]Hibernate version:[/b] hibernate 2 Mapping documents: User.hbm.xml

59. Confused how to code not in query for many 2 many rel    forum.hibernate.org

Hibernate version: 2.1.2 Mapping documents: HostLeague.hbm.xml ... Club.hbm.xml ... Code between sessionFactory.openSession() and session.close(): ... HostLeague hlg supplied as parameter to method List clubs = session.find ("from Club as clb " + "where clb.id not in " ...

60. Hibernate Query --    forum.hibernate.org

61. hangs on a query    forum.hibernate.org

Hello: I'm running into trouble when I do the same query multiple times. It happens right before it actually runs the query: 2005-05-05 11:40:36,615 DEBUG [net.sf.hibernate.impl.BatcherImpl] - I get that in the log then it just hangs there and nothing happens. Am I configuing something wrong? The weird thing is that it ...

62. one-to-one versus multiple queries    forum.hibernate.org

Newbie Joined: Wed Apr 27, 2005 9:53 am Posts: 10 Hi I have a problem using one-to-one in entities For example, i have an entity Activite who have 2 one-to-one relations like this When i get an Activite object with this code (Activite)HibernateUtils.currentSession().createQuery("from Activite where activiteId = "+activiteId).uniqueResult() This always ...

64. Is it possible to get a rowCount from a Query?    forum.hibernate.org

Our project was indeed originally architected using Hibernate 2.x, but we have just recently switched to 3.x. And while we do indeed have our own custom HqlBuilder to generate many queries, there yet exist many (~200) named queries stored in the mapping files. These queries come from various people on the other side of the building, and as a result we ...

65. Many-to-many and queries    forum.hibernate.org

I know this has to be documented somewhere but I can not find it. I have a many to many (users to groups) and want to find all the users by what group they are in. Hibernate version: 3.0.5 Mapping documents: ...

66. query algorithm    forum.hibernate.org

I'm using Hibernate with AndroMDA (http://www.andromda.org) which uses version 2.1.8. The generate code uses the following to do a search query: - net.sf.hibernate.Criteria - net.sf.hibernate.expression.Expression.ilike The "criteria.list()" returns a list of my entity, that's fine... The problem is my entity has many relationships to other entities, so Hibernate create a unique relationship query to create the depend entities, that's fine... But ...

67. Deadlocked situation on a query    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 2.1.8 Hi, Im using Hibernate 2.1.8 as my ORM tool and I have deployed the application to JBoss 4.0.2, Im using the Thread pool session factory pattern and dont hook into any of the features the JBoss exposes for hibernate integration. The problem Im currently facing is that Hibernate ...

68. Many to One Query    forum.hibernate.org

Hi There, This is prob a basic question but finding it hard to find a good answer. I have three tables. A user table A menu table a user_to_menu table. The user_to_menu table just contains an ID, USERID,MENUID, Sampel Date id userid menuid 2 5 1 2 5 2 2 5 3 2 5 4 I think i am wrong in ...

69. SQLite cannot parse query    forum.hibernate.org

Hi, I need to use Hibernate with the SQLite database. The database schema makes use of composite ids. Because there is no SQLite dialect I use the GenericDialect. The problem is that Hibernate produces SQL which SQLite cannot execute. The HQL query looks like: Code: select link from Link as link, ...

70. Paginated Queries    forum.hibernate.org

I want to run a query that returns 10 results per page. I know I can use "setFirstResult" and "setMaxResults" to get the items for the current page. But, I also want to display to the user "page x of y of z results". I know x is the current page. Y can be calculated if I knew Z. I can ...

71. many-to-many query woes    forum.hibernate.org

72. Is it possible to create a "killer query" in Hiber    forum.hibernate.org

Thought I'd ask here before I go browsing the code and running experiments. Is it possible to create a "killer query" in Hibernate? That is could I do a find that causes so many objects to be instantiated that the system runs out of memory. And if so, how are people dealing with this? Explicit row limits in all queries?

73. Use of any tag regarding queries    forum.hibernate.org

Hi. I'm currently thinking about associations to interfaces. For some reason I don't want to map the interface to a -Tag, so the common way to map the association is to use the tag. This works fine to map the association, but it sucks when it comes to queries (for example "find all objects associating no interface" or "find all ...

74. Query causing NPE    forum.hibernate.org

I'm using Hibernate 3.0.5 and am trying to run the following HQL query Code: select user.uid,user.password,user.authorities from UserBackingData as user where user.username = ? This causes Hibernate to throw a NPE. I've tried with different combinations of joins but nothing seems to help except for taking the user.authorities select element out. I'm not sure what's going on, but I'm guessing it's ...

75. Hibernate query    forum.hibernate.org

76. about a query    forum.hibernate.org

77. LoadEventListener and queries    forum.hibernate.org

Hi all, A question about the Hibernate3 event listener system. As far as I can tell, LoadEventListeners are only notified if you call session.load(id), and not if you do something like criteria.list().next(). Is this correct? If so, is there a lifecycle event that is fired when an object is instantiated as the result of a query? thanks in advance Chris

78. How to implement this query?    forum.hibernate.org

79. Using Hiberate 3.0 Query Parser    forum.hibernate.org

80. whats wrong with this query    forum.hibernate.org

what's wrong with this qeury Query query1 = session.createQuery("from OrderBean order,CustomerBean customer where order.intCustomerId = customer.customerId and order.dateField = :strDate"); query1.setParameter("strDate",strDate); hibernate generates sql as shown below and application server halts, no action Hibernate version:3.0 my hibernate code is as under Code between sessionFactory.openSession() and session.close(): String strDate = (String) request.getParameter("date"); System.out.println("Date : " + strDate); Query query1 = session.createQuery("from OrderBean ...

81. ArrayStoreException on query    forum.hibernate.org

Newbie Joined: Tue Mar 01, 2005 1:27 pm Posts: 4 Hi, I am getting an intermittent ArrayStoreException when running certain query. The exception occurs in HashMap.java. Looking at this code I don't understand how an ArrayStoreException can be thrown, unless the object itself is corrupted via threadsafe issues. That it seems to happen when multiple requests are running concurrently is further ...

82. Trying to create a query    forum.hibernate.org

Hi All, Here is what I have Table1 = Item Table2 = WorkspaceMember Table3 = Trustee Item.java, WorkspaceMember.java and Trustee.java exist along with their XML files. Item has 1..M WorkspaceMember which has 1..M Trustees I want to construct a findByExample query that will find all Items which contain Trustee x Here is the SQL as I am seeing it. select a.* ...

83. Hibernate3 query translator missing comma in from    forum.hibernate.org

Author Message assaf Post subject: Hibernate3 query translator missing comma in from Posted: Fri Oct 07, 2005 11:42 am Newbie Joined: Thu Dec 04, 2003 5:53 am Posts: 11 Location: Toulouse, France In Hibernate2, this query was getting translated correctly. In Hibernate3, the SQL generated is missing a comma after an inner join and before an implied table. See ...

84. how to query sets    forum.hibernate.org

hi all, i have a prob, is it poss to query hibernate like below u.userGropu is a set in my class and user.getUserGroup() also returns a set. s.find("from User u where u.userGroup='"+user.getUserGroup()+"'" + "order by u.name"); I get the following error, is there anything i am doing wrong....as querying in a loop while passing each member of set to query seems ...

85. latitude/longitude address distance query    forum.hibernate.org

I'm using Hibernate 3 with the following Criteria Query: List businesses = session.createCriteria(Business.class) .add(Restrictions.like("name", likeCriteria)) .addOrder(Order.desc("currentRating")) .list(); Based on my mappings below how can I add a distance calc in here for the latitude/longitude. I'm VERY concerned with speed. Do I need a Projection? ...

86. Is Hibernate suitable only for lookup queries?    forum.hibernate.org

Hello, I am trying to evaluate Hibernate for a reporting project which involves complex 4-5 production queries. Currently we use in house db control built on top of RowsetDynabeans. Is hibernate a candidiate for these simple queries where no persistance involved. Also instead of HQL, can I use the queries provided by DBA as it is? Any experience of using OSCache ...

87. SessionFactoryImpl: Checking 15 queries    forum.hibernate.org

88. Query best practice    forum.hibernate.org

Our domain is a hierarchy of Scorecard Scorecards( can have one to many) Measure(can have one to many) KeyPerformanceIndicator Each object at every level has a versioned id(a generated string and a version) and a set of effective dates. When this hierarchy is to be retrieved, the hierachy is to be built so each defintion is the max version based on ...

89. How to implement nvl in Hibernate Query?    forum.hibernate.org

Hi, I'm facing a peculiar issue where in I have to query with a constraint on a nullable field. say something like select * from soldto soldto where nvl(soldto.rowstate,0) != 2000. Is there a way, I can implement this in Hibernate? Or do I have to resort to native SQL? Thanks for your Help Dheepak.

90. Account Query operation using HistoryInterceptor    forum.hibernate.org

[b]Hibernate version:[/b] Hibernate 3.0. I am using HistoryInterceptor for AuditLogging in my Application and it looks pretty good while considering the Create,Update and Delete operations.I would like to know whether there is some implementation to make the HistoryInterceptor account for 'Select' or 'Query' operations too. I tried with the select operations and it seems only the afterTransactionCompletion(Transaction arg0) is getting called ...

91. whats wrong with my query?    forum.hibernate.org

thank you Beejal for your reply... still I get copies of the first result row. Just copies???!!! But select obj.attributeValueDescription from Support obj where obj.attributeName = 'B PROT CLASS'" returns right results but an object with one column. I wish I don't have to type in 120 or so columns to get the whole row of data??!!

92. Subselects on the "from" part of a query    forum.hibernate.org

Hibernate version: 3.0.5 Hi. I have a UserSubject class with a date and two many-to-one assotiation, user and subject. I'm trying to select only the latest rows for each subject and one given user, based on the date field. I've got a query that works on MySQL 4.1 and gives me what I want, but can't port it to HQL. MySQL ...

93. Upgrade from 3.0.5 to 3.1 breaks queries    forum.hibernate.org

I'm trying to upgrade from 3.0.5 to 3.1. I'm running into a problem where I've got a query like "from Contact where institution = ?" where institution is a property of Contact managed by Hibernate with a foreign key. It looks like Hibernate is just passing "institution" through straight thru to the sql query rather than doing a join with the ...

94. Hibernate Query    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp [b]Hibernate version:[/b] [b]Mapping documents:[/b] [b]Code between sessionFactory.openSession() and session.close():[/b] [b]Full stack trace of any exception that occurs:[/b] [b]Name and version of the database you are using:[/b] [b]The generated SQL (show_sql=true):[/b] [b]Debug level Hibernate log excerpt:[/b] Hello Hibernate Users, I am fairly new to Hibernate and i was wondering if i could ...

95. Query java.lang.OutOfMemoryError    forum.hibernate.org

Author Message call Post subject: Query java.lang.OutOfMemoryError Posted: Thu Jan 12, 2006 9:32 am Newbie Joined: Thu Jan 12, 2006 9:04 am Posts: 3 I have a serious problem retrieving records from a database. Using the jsp code below. The customer object has a subobject account. Both have Id fields autogenerated. The ID field of customer is 0 and ...

96. Querying for many-to-many scenario    forum.hibernate.org

Hello there, I have been trying to query data for many-to-many without any success. Any help is hugely appreciated. Thanks a million in advance. I want to find a list of all Questionnaires for the given Question. ======================================== Hibernate is generating this query : 2006-01-20 17:14:10,453 DEBUG: JDBCExceptionReporter:line63:logExceptions: could not execute query [select questionna0_.QuestionnaireId as Question1_, questionna0_.QuestionnaireName as Question2_5_ from VoteQuestionnaire ...

97. hibernator:execute query    forum.hibernate.org

hibernator log shows the following : Ignoring resources in Project output: /SY-MIS-Client/build/classes Adding Project Depedents C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/lib/hibernate/commons-logging-1.0.4.jar Adding Project Depedents C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/lib/hibernate/hibernate3.jar Adding Project Classpath file:/C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/build/classes/ Adding Mapping - C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/ejbModule/model/User.hbm.xml Adding Mapping - C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/ejbModule/model/ServiceType.hbm.xml Adding Mapping - C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/ejbModule/model/Service.hbm.xml Adding Mapping - C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/ejbModule/model/Company.hbm.xml Adding Mapping - C:/Documents and Settings/jennyhii/workspace/SY-MIS-Client/ejbModule/model/Authorizer.hbm.xml is ...

99. Hibernate statistics not showing all queries    forum.hibernate.org

Hi All, I'm quite new to this hibernate stuff, so please excuse my ignorance if I'm being really daft. I'm exploring the hibernate statistics object so that I can measure the performance of the queries in my application (generate_statistics is true). Although I can see in the log (show_sql is true) that queries are being being sent to the database, the ...

100. Regarding Hibernate Query    forum.hibernate.org

for eg. I have a two table. 1. DEPTS 2. EMPLOYEE BOTH FILES LOOK LIKE ********************************************************** DEPTS.HBM.XML ********************************************************** ********************************************************** EMPLOYEE.HBM.XML **********************************************************