hql 2 « HQL « JPA Q&A





1. HQL Question    forum.hibernate.org

Hi. Suppose I have a class like that: public class Student { private String name; private float grade1, grade2; /* Omitted accessors and mutators, that is, get and sets for attributes above*/ public float getAverageGrade(){ return (this.grade1+this.grade2)/2.0 } } And I want to retrieve from the database, only the students that have passed (whose average grade is greater than 5). Can ...

2. hql help    forum.hibernate.org

Can anybody tell me what is wrong with the following query: select ord.id from test.Order ord join ord.orderItems item where (ord.orderDate < '2001-01-01' AND item.amount < 100) AND sum(item.price) < 1000 hibern8ide gives the following error message: 1 errors occurred while listing (and calling getPathNames). net.sf.hibernate.JDBCException: Could not execute query java.sql.SQLException: General error in statement [select order0_.ID as x0_0_ from ORDERS ...

3. HQL problem    forum.hibernate.org

Hi, This is the sql query I have which uses outer joins. select a.muuid,a.forum_name,count(b.muuid) topics,sum(b.topic_noposts) posts,a.createddate from um_forum a left outer join um_topic b on b.forum_id = a.muuid group by a.muuid,a.forum_name,a.createddate order by a.forum_name,a.createddate desc This is the HQL I have written. Please write me whether this HQL is correct or not. select a.muuId,a.name,count(b.muuId),sum(b.postsNumber),a.createdDate from Forum as a,Topic as b join ...

4. HQL problem    forum.hibernate.org

Author Message dazbaz Post subject: HQL problem Posted: Thu May 27, 2004 9:13 am Newbie Joined: Thu May 27, 2004 9:04 am Posts: 2 Hi all, I am trying to filter a list of institutions based on a primary key and a joined tables address type (which is part of a composite key). Code: List institutionList = session.find("select mci ...

5. HQL problem    forum.hibernate.org

6. HQL help needed    forum.hibernate.org

Hi all, does anyone know the proper hql for the following? Class A has a collection of Class B mapped in a middle table. I want to get all B that aren't in any collection in A, basically all B that don't appear in the middle table. I can do it be getting all the id's for B that are in ...

7. HQL question    forum.hibernate.org

I've read the documentation. But I don't know to use HQL. For example, SQL: "select * from account where account = '" + account "' and password = '" + password + "'" HQL Query query = session.createQuery("select account from Account account where account.account = '" + account + "' and accont.password = '" + password + "'"); But it doesn't ...

8. HQL problem........    forum.hibernate.org

Hello everybody, I have two classes: Here is my hbm.xml file

9. using "in" in HQL over a Set    forum.hibernate.org





10. contstants in HQL    forum.hibernate.org

Hi, can anyone tell me if it is possible to use a constant value (e.g. true) in HQL select new dummyDTO(pers.name,true) from Person as pers where pers.id = :id so here I want to past true as harcoded value so I won't need a spereate constructor on my DTO (Data transfer Object) Thanks very much in advance

11. HQL Question    forum.hibernate.org

Hi folks ! I'm new to hibernate but already read some tutorials, reference manuals and wrote some test applications. First thanks to all of you who contributed to hibernate, it's a geat software ! My Question: Is there any possibility in a HQL query, to use the return value of a method call in the where clause... something like this: "from ...

12. HQL question    forum.hibernate.org

13. Unable to solve hql mystery    forum.hibernate.org

Hi there, I have got this query here: String query="select elements(c.companyContactGroups) from User as u inner join u.companyGroups as compgs inner join compgs.company as c inner join fetch c.companyContactGroups as ccg inner join fetch ccg.contacts where u.id="+userId; There are basically 2 questions i have here, the syntax of the query is correct and there are 2 fetch clauses in the query. ...

14. HQL and display    forum.hibernate.org

15. HQL question    forum.hibernate.org

16. What is the HQL for accessing a one-to-many    forum.hibernate.org

Hi Trying out my HQL against a one-to-many and not having much luck. I'm trying to select all the 'messages' for a given 'MessageStore'. The message has a FK column called inbox_id pointing back to the MessageStore table. My Hib' querry is (which does work): from net.simtext.server.core.domain.Message as message where message.id>? and message.inbox_id = ? My SQL querry which does what ...





17. Amazing !! HQL with exp and expe    forum.hibernate.org

18. Help with HQL    forum.hibernate.org

Hibernate version: 2.1.6 I was wondering if anyone could help me out with HQL. I have three mapped objects: Code:

19. HQL and RTTI    forum.hibernate.org

Newbie Joined: Thu Aug 05, 2004 1:54 am Posts: 10 Location: Novosibirsk, Russia Hibernate version: 2.1.6 ( MySQL DB ) Mapping documents: Code: ...

20. single quote in HQL is not being parsed properly    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents: Code between sessionFactory.openSession() and session.close(): List list = session.find("select event from Event event where event.eventName like \"%vikas's%\""); Full stack trace of any exception that occurs: 19:24:52,750 DEBUG [QueryTranslator] HQL: select event from com.xxx.Event event where event.eventName like "%vikas's%" 19:24:52,750 DEBUG [QueryTranslator] SQL: select event0_.ID as ID, event0_.DESCRIPTION as DESCRIPT4_,event0_.EVENTNAME as EVENTNAME, from EVENT event0_ where (event0_.EVENTNAME ...

21. Using interfaces in HQL    forum.hibernate.org

Its definitely mapped i.e. Hibernate's logging clearly show the mapping gets loaded OK. I think the problem is that i want to use the interface WebSite in the HQL but hibernate expects the concrete class WebSiteImpl ( when i do the substitution the query completes fine). I suppose I need to use a joined-subclass with a discriminator column. I ...

22. Very complicated modeling/HQL question    forum.hibernate.org

Hibernate version: 2.1.6 or 3.0cvs Mapping documents: I am trying to map a very oddly structured legacy database into something that is more or less a clean object model. I have most of the model in hibernate and it works well, but i have one big stumbling block which makes the model non-transparent: In our DB, we store 'null' as some ...

23. what's wrong with this HQL?    forum.hibernate.org

the class is here: public class CmrcCategory implements Serializable { /** identifier field */ private Integer categoryId; /** nullable persistent field */ private String categoryName; /** persistent field */ private Set cmrcProducts; ... the HQL is here List l=session.CreateQuery("select c.cmrcProducts from CmrcCategory c where c.categoryId='14'").list(); the Exception is here expecting 'elements' or 'indices' after: id [select c.cmrcProducts from code.model.CmrcCategory c where ...

24. hql problem    forum.hibernate.org

im trying to get all the users who have a specific book i tryed all sorts of ways but i cant get anything but errors i would think that something like "from User u where u.bookshelf.booklines.book.isbn = 2222" would work but i dosent. a user have a bookshelf that contains booklines that contains a book please help me get on from ...

25. Advanced HQL    forum.hibernate.org

Hibernate version: 2.1.6 Hi, I have a class named "Entity", mapped to table "ENTITIES" (see below). I have defined a map collection into "Entity", to obtain properties of an entity, as shown in the following markup /** * @hibernate.map name="textAttributes" table="ENTITY_ATTRIBUTES" lazy="true" cascade="all-delete-orphan" * @hibernate.collection-key column="ENTITY" * @hibernate.index-many-to-many column="ATTRIBKEY" class="nf.bsf.beans.common.Name" * @hibernate.collection-element column="ATTRIBVALUE_TEXT" type="java.lang.String" * @return Map */ So, cleanly I ...

26. Advanced HQL    forum.hibernate.org

b]Hibernate version:[/b] 2.1.6 Hi, I have a class named "Entity", mapped to table "ENTITIES" (see below). I have defined a map collection into "Entity", to obtain properties of an entity, as shown in the following markup /** * @hibernate.map name="textAttributes" table="ENTITY_ATTRIBUTES" lazy="true" cascade="all-delete-orphan" * @hibernate.collection-key column="ENTITY" * @hibernate.index-many-to-many column="ATTRIBKEY" class="nf.bsf.beans.common.Name" * @hibernate.collection-element column="ATTRIBVALUE_TEXT" type="java.lang.String" * @return Map */ So, cleanly I ...

27. HQL Question    forum.hibernate.org

Dear All, I have these classes.... Parent and Child so we can do something like p.getAllChildren() where p is instantiation of Parent and that function return List of child. So in HQL can i do ... from Child as child where Parent = p; where p is object of Parent, taken from somewhere else. If not, how do we retrive .... ...

28. ORing in HQL    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents: Code: ...

29. HQL help    forum.hibernate.org

Hi, I've got three Hibernate entity; User, Report, and Role Their relationship is as follows: User <-----n, m-----> Role <-----n, m----- Report User entity has a field called "userName" and I have the value of this field. I want to have the list of reports that is associated with this user. How can I get this list with a HQL query? ...

30. Help with HQL    forum.hibernate.org

Hi there how do I write a Hibernate query for the following situation? I have a MailList object, which contains a Collection of Contact objects. There is a many-to-many relation between MailLists and Contacts. So MailLists can contain 0 to many Contacts, and Contacts can be contained by 0 to many MailLists. Now I want to find all the MailLists which ...

31. HQL NEED HELP!!!    forum.hibernate.org

Hi, This solutin didn't work, I got an QueryException, then I chenge the query to select h from House as h, Person person where person.age<20 and person in elements(h.persons) which makes sense... an I get a few objects of class House$$EnhancerByCGLIB$$56a42fa which contains tha attributes of House class but with null values. very strange! how can I obtain the real House ...

32. HQL feature suggestion    forum.hibernate.org

Newbie Joined: Sat Dec 04, 2004 7:35 am Posts: 1 Location: Sweden Hi, I'm in the middle of my first Hibernate project, so I might have missed how to do certain things. However, here is a simplified view of my problem (and solution): Lets say I have the following pojos: A, B, C, D A has one-to-many relationships to B, C ...

33. HQL help    forum.hibernate.org

34. [ann] Hibernate ORM and HQL Scripting    forum.hibernate.org

Hello, I'd like to introduce Hibernate scripting, a new feature in the JudoScript language, and hope to get some feedback from active Hibernate developers. The crux of Hibernate scripting in JudoScript is demonstrated as follows: 8< - - - - - - - - - - - - - - - - - - - - - - - - - ...

35. Help needed on HQL    forum.hibernate.org

Hello, I need your help for a query in HQL involving 3 classes. class Configuration { Long id; Set items; } class Item { Long id; Configuration configuration; Set translations; } class Translation { Long id; Item item; Locale locale; ... } I'm looking for Item, for a given Configuration, that don't have any Translation for a given locale. Thanks in ...

36. network traffic for one HQL    forum.hibernate.org

Login Register FAQ Search View unanswered posts | View active topics Board index Hibernate & Java Persistence Hibernate Users All times are UTC - 5 hours [ DST ] network traffic for one HQL Page 1 of 1 [ 1 post ] Previous topic | ...

38. HQL Problem    forum.hibernate.org

Hibernate version: 2.1.8 Name and version of the database you are using: MySQL 4.0.22 Can anyone tell me why the following HQL succeeds but when I change the '+' to a '*' it fails? select cust.fname, cust.lname, prod.description, sum(ordl.quantity + prod.unitPrice) from PrivateCustomer cust left join cust.orders ords left join ords.orderline ordl left join ordl.product prod where ords.id > 0 group ...

39. Quick HQL question    forum.hibernate.org

angry planet wrote: I have a table that has a timestamp column. What is the most efficient way to retrieve the most recent record? There could be many records in this table and I am afraid ORDER BY and subselects might get too slow, but maybe that is not a valid concern. I want to do something like "Select emp.lastName from ...

40. How to do that in HQL ??    forum.hibernate.org

41. HQL question    forum.hibernate.org

I have a client, and a client has many partecipations. Every partecipation has a date. I modelled it with a property set in client and property date in partecipation, and the 2 entity are connected by one-to-many (it is a set collection). I want to obtain the whole list of clients ordered descently by the max partecipation date owned by its ...

42. Hql Lexer and french accents...    forum.hibernate.org

Hello ! I think the Hql lexer doesn't accept accent... Here is the stack trace for query "From com.atos.vigile.vigistudio.model.admin.structure.Role role WHERE role.Nom='Intgrateur'" : (Hibernate version : 3.0.beta4) Code: Caused by: line 1:84: expecting ''', found '' at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:278) at antlr.TokenBuffer.fill(TokenBuffer.java:69) at antlr.TokenBuffer.LA(TokenBuffer.java:80) at antlr.LLkParser.LA(LLkParser.java:52) at org.hibernate.hql.antlr.HqlBaseParser.primaryExpression(HqlBaseParser.java:2919) ...

43. Help with HQL (over several many-to-many)    forum.hibernate.org

I'm pretty new with Hibernate/HQL. I have created a SQL query executed with a createSQLQuery() that does what I want but that doesn't feel right and it probably isn't that performant either (don't know if it uses 2nd level cache for example). So here is what I want to do: I want to select all active Channels (Channel.active) for a specific ...

44. HQL help please    forum.hibernate.org

Hi, I'm working with the PetClinic demo which comes with Spring. I thought I'd make some changes to it so I could learn how it works, but have come up against some difficulties. I decided to allow Vets (instead of just Owners) to have Pets. vets(id[s], firstName, lastName[/s]) (with the restriction that vets.id must be from owners.id - owners should now ...

45. HQL for a Many-to-Many via Relationtable    forum.hibernate.org

Hi folks, I'm stuck and searched quite a long time for a problem that surely isn't that big... I have two objects: Book and Person. Each Book may have many authors (instances of Person) and each Person may have written many Books. Many-to-Many. The tables existing in my DB are: - book - books_and_authors - person Book and Person have a ...

46. Case sensitivity in HQL    forum.hibernate.org

I think not keywords but comparsion see the example below: FROM Foo as a WHERE a.property='Any WoRdS' (I can use "binary" keywords in Hibernate 2 - in HQL - that was right for me, when I use that the case sensitivity was good) and the comparsion only will be true if the property's String exatly equals to 'Any WoRdS'. Is it ...

47. Case sensitive comparsion in HQL    forum.hibernate.org

FROM Foo as a WHERE a.property='Any WoRdS' do case sensitive comparison (return exactly 'Any WoRdS' ) If you want case insensitive try FROM Foo as a WHERE upper(a.property)=upper('Any WoRdS') (if your dialect support upper function) Have you tried ? If it doesn't work you have problem with database (what is sql query then) regards

48. How can I use "case ... when...else...end" in hql?    forum.hibernate.org

Hi, I wanna use "case ... when...else...end" in query, I found in the document it is said supported, but i had no luck to make it work. The query i made is: Code: "Select t.id" + t.nameCN, ...

49. HQL - Howto    forum.hibernate.org

50. HQL and s    forum.hibernate.org

51. Embarassingly basic HQL question...    forum.hibernate.org

Hi, I'm trying to write a query which selects objects where objecttype.name doesn't start with an alpha. I don't have a strong SQL background and I haven't been able to work out how to do this other than the brute force approach which creates an ugly long query. I'm sure there must be a simpler way to do this - any ...

52. dynamic instantiation HQL question    forum.hibernate.org

53. HQL Help    forum.hibernate.org

54. hql client ?    forum.hibernate.org

55. the question of the hql .    forum.hibernate.org

SELECT a.CONFIRMEDDATETIME,a.APPLICATIONSERIALNO, IFNULL((TO_DAYS(CURRENT_TIMESTAMP) - TO_DAYS(a.CONFIRMEDDATETIME)), (TO_DAYS(CURRENT_TIMESTAMP) - TO_DAYS(a.SENDEDDATETIME))), b.UNSEALEDFLAG, b.CONFIRMATIONNO FROM TBL_APPLICATION a, TBL_APPLICATIONCONFIRMATION b WHERE a.NEXTCONFIRMSEQ = b.CONFIRMATIONSEQ AND a.APPLICATIONSERIALNO = b.APPLICATIONSERIALNO AND ( ...

56. HQL Calculate hours worked    forum.hibernate.org

I would like to calculate how long an employee has worked. I currently have MySQL and I am unable to use timediff() function of mysql to calculate the difference between logintime and logoutime. Could someone tell me what HQL I would need. The following is in native SQL: select timediff(el.logintime, el.logouttime) from EmployeeLogon el where el.EmployeeID = 31 When I try ...

57. how do I translate this in to HQL?    forum.hibernate.org

Author Message aturetsky Post subject: how do I translate this in to HQL? Posted: Mon Aug 08, 2005 1:06 pm Regular Joined: Fri Jan 28, 2005 3:11 am Posts: 81 Here is my SQL query: Code: select count(*) from sdt_program_table s inner join idms_part_prog_table p ...

58. How to use Modulo Operation ( 10 % 3 = 1) in Hibernate HQL.    forum.hibernate.org

Hibernate version: 3.0.5 HI, I have a pretty silly question about Modulo Operation in HQL. How can I use it in a HQL query. I think I missed a function Name or operator for this. My Searching on the Forum and on the Internet had no success in finding any infomration about this topic. It seems to me that hibernate does ...

59. Parentheses not handled properly in HQL where?    forum.hibernate.org

Author Message tomik Post subject: Parentheses not handled properly in HQL where? Posted: Fri Aug 12, 2005 9:56 am Newbie Joined: Fri Aug 12, 2005 9:27 am Posts: 2 Hi! I generated an simple HQL query: Code: from Subscription sub where (sub.beginTime=null and sub.endTime=null) or (sub.beginTime>=:now and sub.endTime=null) or (sub.beginTime>=:now and sub.endTime<=:now) or (sub.beginTime=null and sub.endTime<=:now) SQL generated by ...

60. after migration to hib3 HQL containging " doesn't work    forum.hibernate.org

String queryString = "from " + XY.class.getName() + " WHERE stringTypeAtribute = \"" + param1 + "\""; getHibernateTemplate().find(queryString); end with this exception. On hibernate 2 works fine. why? are there any similiar incompatibilities betwen hib2 and hib3? org.springframework.orm.hibernate3.HibernateQueryException: unexpected char: '"' [select count(*) from cz.aura.isl.katalog.davky.domain.transaction.AdresatTransakce as adresat WHERE adresat.pk.kmoeext = "dasfdsf" AND adresat.pk.outputHeader.id = 43]; nested exception is org.hibernate.QueryException: unexpected char: ...

61. Basic HQL Question    forum.hibernate.org

Hi. I have a very basic HQL question. I've been trying to retrieve data from database by passing a variable but having a problem with it. I could retrieve data by passing actual value but I'm not sure how to pass the variable which is a primary key in the table and retrieve one row from the database. It's failing on ...

62. Hql question?    forum.hibernate.org

Query query = session.createQuery("from Jobs as j"); in Hibernate runs smoothly, but in Hibernate 3 doesnot run. I use eclipse create two projects, one used hibernate2 the other used hibernate 3. Both projects codes are the same, except the jar files in lib. I have no ideas about it , is there some gentlemen konwing the reason. Thank a lot.

63. HQL Problem : Unexpected Token    forum.hibernate.org

Newbie Joined: Wed Sep 07, 2005 10:17 pm Posts: 2 Hi, Can anyone help with the following? I am getting the following error: org.hibernate.hql.PARSER *** ERROR: line 1:144: unexpected token: date when I run the HQL: FROM Customer as c where c.firstName LIKE :firstName and c.surname=:surname and c.dob=:dob and c.memberEndDate>current date I am using Hibernate 3.0 with Db2. There is no ...

64. The Use Of Apostrophe(') and Quotes(") in HQL    forum.hibernate.org

Hibernate version: 2.1.1 Mysql 4.0.20: Hi there, I have code that executes without problems using HQL to find a list of objects with a certain "name" using the LIKE operator (see example and SQL below). However, the moment the "name" contains an apostrophe (') it does not return any values. What is the correct way to search for or use apostrophe's ...

65. HQL Problem: Help!    forum.hibernate.org

66. XPath to HQL    forum.hibernate.org

67. Un able to get HQL to work    forum.hibernate.org

My sql code looks as follows select e.id from entry e, groups_belong_to_group_member g where e.id=g.groups_belong_to_id and group_entry='Yes' and name like '%(Countries)%'; "groups_belong_to_group_member g" stores the value of e.id that is linked to a entry. Therefore you could use the following code as well: select e.id from entry e where group_entry='Yes' and name like '%(Countries)%' and e.id in (select e.id from entry ...

68. hql parsing problem    forum.hibernate.org

69. Help to write a specific HQL    forum.hibernate.org

Query select = session.createQuery("from EstoqueMP e where " + " e.qtde < e.materia.estoqueMinimo " + " and e.data = (select max(data) from EstoqueMP e1" + " where e1.materia = e.materia" + " ...

70. Problem with HQL    forum.hibernate.org

Newbie Joined: Thu Oct 20, 2005 3:07 pm Posts: 1 Hibernate version: 3.0 Name and version of the database you are using: Oracle 10 Hi, I've writed this hql query wich is a little bit complicated, Code: select max(pg.product.productModel.subgroup.group.section.description) as sectionDescription, max(pg.product.productModel.subgroup.group.section.functionalNumber) as sectionFunctionalNumber, pg.id as id, max(pg.product.description) as ...

71. HQL for multilanguage support    forum.hibernate.org

Hi, I have the following classes (I extracted the relevant parts): public class Text { ... @OneToMany(mappedBy = "text") @MapKey(name = "locale") @Cascade(value = CascadeType.ALL) public Map getTranslations() {...} } public class TextTranslation { ... public Locale getLocale() {...} @Type(type="text") public String getTranslation() {...} @ManyToOne public Text getText() {...} } public SomeEntity { ... public Text getName() {...} public Text ...

72. HQL question.    forum.hibernate.org

Can some one please explain to me why do I get different result for two following queries. Query 1: Select c from Category c join c.items i where i.name = 'Item1' The generated SQL (show_sql=true): select category0_.categoryID as categoryID1_, category0_.name as name1_ from externdb.dbo.Category category0_ inner join externdb.dbo.Item items1_ on category0_.categoryID=items1_.categoryID where items1_.name='Item1' select items0_.categoryID as categoryID1_, items0_.itemID as itemID1_, items0_.itemID ...

73. Simple HQL question    forum.hibernate.org

I can search within the properties of the scholarship table just fine but queries into any of the sets arent working. Anyone know why? Hibernate version: hibernate-3.0.5 Mapping documents: A representation of an ASU scholarship protected

75. Problems with HQL (many-to-many)    forum.hibernate.org

Hi people. I'm executing this code: AuthChaveAcesso chaveAcesso = (AuthChaveAcesso) session.load(AuthChaveAcesso.class, "100008"); Query query = session.createQuery("from Pedido p where p.agente.chavesAcesso in (:chaves) "); query.setParameterList("chaves", new Object[] {chaveAcesso}); System.out.println(query.list()); And this error occurs: ERROR util.JDBCExceptionReporter logExceptions - ORA-00936: missing expression This query is resulted: select pedido0_.REPE_PEDIDO_NU as REPE1_, pedido0_.REPE_INCLUSAO_DT as REPE3_39_, pedido0_.REPE_OBSERVACAO_DS as REPE4_39_, pedido0_.REPE_OBSERVACAO as REPE5_39_, pedido0_.REPE_ENTREGA_FUNC_RG as REPE6_39_, pedido0_.REPE_ENTREGA_FUNC_NO as ...

76. HQL    forum.hibernate.org

HQL is (primarily) used for mapping returned values to java classes. That bit of SQL isn't returning any values. HQL is not appropriate in this case. Just in case you weren't aware of this: don't use "select ... into ..." in production code. Because it creates a table at the same time as doing a select, it locks several important system ...

77. hibernate tools - HQL scratchpad    forum.hibernate.org

Max tried as per your suggestion i am getting below errors even i used complete path of my Do i need to add any jar files in my application lib. At present i have only SQL Server Drivers msbase.jar,mssqlserver.jar,msutil.jar hsqldb.jar hibernate-tools.jar hibernate3.jar -------------------------------------------------------------------- 1) from com.edhand.example1.Item error in Hibernate Dynamic Query Transalator org.hibernate.QueryException: unexpected char: '"' ["from Item" ] Caused by: ...

78. hql documentation    forum.hibernate.org

Hi, I'm working with hibernate for a few days. I've read the documentation by I found that the part refering to HQL is not satisfying. Can you please tell me anywhere that I can find full explain of the use of joins, paths, etc besides the limited examples found at the documentation I've read. Thank you in advance....

79. paramters in HQL    forum.hibernate.org

...

80. HQL problem    forum.hibernate.org

Newbie Joined: Wed Mar 08, 2006 7:12 am Posts: 3 Sorry for giving so few details :) The files have been generated with Hibernate Tools for Eclipse. The database is PostgreSQL and the table in this case has the structure: CREATE TABLE eurolegis."AboutEUTree" ( "TextRo" numeric, "ParentId" numeric, "TitleRo" text, "TitleEn" text, nivel int2 ) ------------------------------------------------------------------ The files are: 1. AboutEutree.java ...

81. simplest HQL ?    forum.hibernate.org

Criteria criteria = session.createCriteria(myhibernate.valueobjects.Orders.class) .add(Restrictions.eq("patient.personKey",new Long(patient.getKey().longValue()))) .add(Restrictions.ilike("placerOrderNbr",placerIdentifier.getIdValue())); ...

82. HQL support for password encryption?    forum.hibernate.org

There are couple of approaches. 1. You can probably override the MysqlDialect and do a "registerFunction" for the mysql PASSWORD function and use that in your HQL. I havent tried this, but it might be something to explore. Take a look at the Mysqldialect code and youd see the current registration for standard functions 2. use the madcow library ( http://madcow.tigris.org ...

83. Help with HQL and PropertyNotFoundException    forum.hibernate.org

The problem seems to be coming from the Date parameters, i have determined this by adding properties to the constructor one at a time and only when i try to populate a Date field does Hibernate throw the exception. I have mapped the Date type as a java.sql.Date type though is this wrong???

84. HQL 3.0->3.1+: read http://www.hibernate.org/250.html#A33    forum.hibernate.org

Just wanted to spread the word on this so others won't be as surprised as I was. I assumed that 3.1 was a drop in replacement for 3.0.x, but there are issues, such as those listed in the migration guide: http://www.hibernate.org/250.html. Many of my HQL queries used apparently "invalid" syntax that managed to run successfully due to leniency in the HQL ...

85. HQL deep link problem    forum.hibernate.org

@Entity public class Person { @Id private Long id; @ManyToOne private Person father; @ManyToOne private Person mother; ... ...

86. HQL    forum.hibernate.org

What's coming back from the query? Is it a list of many As? Do they all have the speficied ID? Are they all the same? If there's more than one A with a given ID (presumably because it's not a PK), then your query is going to return them all. If there's only one, then it's going to return only that ...

87. Problem migrating from HB2 to HB3, HQL Generating more sqls    forum.hibernate.org

Author Message gabrielguerrero Post subject: Problem migrating from HB2 to HB3, HQL Generating more sqls Posted: Wed May 17, 2006 10:01 am Newbie Joined: Thu Sep 08, 2005 7:52 pm Posts: 4 Hibernate version: 3.2rc1 i try also with 3.0.5 and 3.1.3 Name and version of the database you are using: the originaly happen in 0racle 9i but the ...

88. HQL returning Instances & Scalars returns NULLs    forum.hibernate.org

Hibernate: 3.1.3 Postgres: 8.1.2 Java: 1.5.0_06 A is mapped to B with a primary foreign key. Bidirectional one-to-one mappings used. HQL: "Select a, b from A a join a.b b" works perfectly.. BUT HQL "Select a, b, 'Some scalar' as c from A a join a.b b" Returns "a" and the scalar "c" correctly, but NULLs out b I've built a ...

89. Problem with HQL and one-to-many    forum.hibernate.org

When I try to get the elements of the list occurs the exception: Code: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at br.com.pamcary.j2ee.pamcard.web.struts.action.AbstractAction.execute(AbstractAction.java:116) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) ...

90. downcasting in HQL    forum.hibernate.org

How can I do downcasting in HQL? For example, suppose that I have a query with 2 where clauses C1 and C2 like from A a where C1 & C2 if 1- I know that all "a" objects that satisfy C1 are of type B (which is a cubclass of A) 2- I need to use a field defined in B ...

91. HQL    forum.hibernate.org

92. Please help with HQL (don't read, duplicate)    forum.hibernate.org

93. Please help with HQL    forum.hibernate.org

This is no bug, just need some help with an HQL Query. Hibernate 3.0.5: Mapping documents: I have reduced them to the essentiel parts. Just some basic properties missing, version, id and so on. ParameterSetGroup: Code: ...... ...

94. Question: bit operation in HQL    forum.hibernate.org

Hi, guys, I have a user object which has a bit-stored privacy attribute. When I justify whether a user has a proper privacy I could use 'user.privacy& SOME_PRIVACY '. So I can get all the user has the privacy 16 in mysql database by 'SELECT * FROM user where privacy&16 <>0', My Question is how could I do the same thing ...

95. question about hql    forum.hibernate.org

96. Any way to refer to "IndexColumns" in HQL?    forum.hibernate.org

I have a ManyToMany "List" association with an IndexColumn on both sides. I'd like to order the results of an ad hoc HQL via this index column, but I cannot seem to refer to it without errors. Is there a way to refer to the list index column in HQL? For instance, in my Issue.java code: Code: ... @NamedQuery(name = "ContentByPublication", ...

97. HQL: Using IN with dynamic input    forum.hibernate.org

Regular Joined: Thu Jul 01, 2004 12:13 am Posts: 68 Location: San Diego, CA I am attempting to use HQL's IN functionality to query for a result set "in" a particular set. When I query using HQL I get no results back, but when I query with SQL, results are returned. I need to produce the IN set dynamically based on ...

98. HQL problem    forum.hibernate.org

Hibernate version:last Hello I've a big problem with my a HQL query. I want that my query returns all the CV with a given 'lastname' and a given 'state' of the Result. CV has a set of Result called 'resultList'. My query is like List cvListByname = new ArrayList(); Query q = session.createQuery("from CV where lastname =:lastname and resultList.state = :state"); ...

99. please help! escape % in HQL    forum.hibernate.org

Hi, i have such a problem in my query. i woudl like to query "select * from student where name like '%er%' " and in my HQL i put findByNamedParam("FROM Student s WHERE s. name LIKE %:name%", "name", name) and it causes error because program considers "name%" as the param not "name". How can i make sure that "name" is the ...

100. Newbie HQL question    forum.hibernate.org