query 1 « Query « JPA Q&A





1. Hibernate Queries    stackoverflow.com

Using Named Queries (located in your hibernate mapping xml file) is a nice way to separate your queries from your buisness logic. But what are the alternatives if your are using ...

2. Hibernate Query Hints for JPA    stackoverflow.com

I have been trying to find a definitive resource for all of the hints that can be set through the Query.setHint(String,Object) method call in JPA, but I am coming up empty. ...

3. trouble with writing hibernate query    stackoverflow.com

Hiya, I'm sort a newbie when it comes to hibernate so I'm going to try to ask my question as clearly as possible. I wanna execute following query as hibernate query ...

4. HIbernate Free Query    stackoverflow.com

I would like to query using hibernate given a particulay query string I did it like this:

session = HibernateUtil.getSessionFactory().openSession();
session.beginTransaction();
List<String> result = session.createQuery("Select item_value from cb_items").list();  
session.getTransaction().commit();
session.clear();  
return result;
Is this right? ...

5. Hibernate querycount query, dont know how to do    stackoverflow.com

I want to make an hibernate querycount on a table. I have to values, one string and one boolean HibernateUtil.queryCount(VoteOnPublication.class, new String[] {VOTED_PUBLICATION_ID_FIELD, FOR_OR_AGAINST_FIELD}, **********); my voted_publication_id_field is a string, and my for ...

6. HIbernate query    stackoverflow.com

I want to execute a query using hibernate where the requirment is like

select * from user where regionname=''
that is select all the users from user where region name is some data ...

7. JPA 2 and Hibernate 3.5.1 MEMBER OF query doesnt work    stackoverflow.com

I'm trying the following JPQL and it fails misserably:

Query query = em.createQuery("SELECT u FROM User u WHERE 'admin' MEMBER OF u.roles");
List users = query.query.getResultList();
I get the following exception:
ERROR [main] PARSER.error(454) ...

8. hibernate creates wrong query?    stackoverflow.com

Hi I have basically this mapping:

@Entity
@Table(schema="xas",name="billing")

public class Billing implements Serializable{

private String id;

private List<Subtotal> subtotals = new ArrayList<Subtotal>(3);

@Id
@Column(name = "id", nullable = false,length=32)
public String getId() {
    return id;
}

.....

public void ...

9. More elegant way to write a hibernate query    stackoverflow.com

Can someone help me write a better code. I tried this but its not working :

Query query = session.createQuery("from MyTable order by :sortvariable :sortorder");
query.setParameter("sortvariable", sortvar);
query.setParameter("sortorder", order);
This is not working as well
Query ...





10. JPA or Query Interception    stackoverflow.com

How do I intercept query being executed ? Basically, I have to intercept each and every query executed via EntityManger and log "NATIVE" sql to application server log file for analysis? ...

11. Hibernate: Query Metadata    stackoverflow.com

I'm currently working on a solution to automatically generate ExtJS forms based on a hibernate mapping (I use hibernate reverse engineering for that based on @Annotations). Hibernate has a

getPropertiesInterator() 

12. how to write query in hibernate    stackoverflow.com

I am working with hibernate. I have one table 'User'.In that,I have 3 columns id,name,& email.I want to retrive name for perticular email.I am passing email id,so please help me,how ...

13. create query in Hibernate    stackoverflow.com

When we have to use

createQuery(String),   

createNamedQuery(String),  

createNativeQuery(String)   
in Hibernate and what is the difference between them? Regards,
Mahendra

14. hibernate one to many query    stackoverflow.com

I have following classes-tables with onetomany relationships People

 @Entity 
 public class People{ 
     @Id @Column private Integer id;
     @Column(name="FNAME")  private String fName; ...

15. Open query in hibernate    stackoverflow.com

I am using struts and hibernate in my problem. I tried the following query

String hql ="insert into  "+
        "OPENQUERY(OracleLinkedServer, \'SELECT * FROM  ...

16. Hibernate :: unexpected token : FOR    stackoverflow.com

I have this query be used on hibernate with java:

String hql = "select part.ID,part.PartNumber,part.Name,parttype.Name,partkind.Name,
                  ...





17. Any JPA query builder?    forums.netbeans.org

Hi, Is there any JPA query statement builder which can help us build more complex query from generated Entity Classes in a GUI wizard? Thanks.

18. Q 4 C. Bauer & G. King (2): Hibernate & formulating queries    coderanch.com

Dear authors, In the old days I was used to formulate my queries to the database in SQL. In the new days this has basically remained the same, an SQL query is formulated, although, in the Java application I'm working on, this is done in a rather complicated way (it's the fault of the previous programmers ) What does Hibernate fundamentally ...

19. Hibernate query    coderanch.com

20. hibernate query    coderanch.com

21. Struggling with simple Hibernate Query    coderanch.com

Hey everybody, this is my very first post at JavaRanch. I'm reading here now since I started with Java (around a year ago) and always found a way to solve my problems by myself or by searching. Ok, I'm trying to do my very first steps in ORM with Hibernate. I want to combine stateless session beans (mainly to learn how ...

22. Hibernate Query...    coderanch.com

23. Hibernate Query...    coderanch.com

I have to select two columns from a table. The query looks like this. I just need to get the values of a and b. I used the following in hibernate. List results=session.createSQLQuery("select a as value,b as key from table") .addScalar("value",Hibernate.STRING) .addScalar("key",Hibernate.STRING).list(); Remember that the above query gives 3 rows. what is that i get in results after the query is ...

24. Simple Hibernate query?    coderanch.com

Got a little test Java app that inserts records into Oracle table (no problem) and tries to select them back out (not working). // create table rob (id number, name varchar2(32), created date); public static void main(String[] args) { int iArrayLen = 4; Rob[] robArray = new Rob[iArrayLen]; for (int i=0 ; i

25. Hibernate could not execute query    coderanch.com

hi, I am not able find the answer.I have got the session and when i give createQuery,its printing the query ,but its not executing it.Please help me out. And this the Query i am using list = ss.createQuery("from "+Status.class.getName()).list(); Printed Query Hibernate: select status0_.StatusCode as StatusCode2_, status0_.StatusName as St atusName2_ from status status0_ This is my Hibernate.cfg.xml configuration ...

26. Hibernate Query    coderanch.com

27. Estimate length of hibernate query    coderanch.com

Well you can't really know up front what an ad hoc query is going to return in size, and how long the database will take to retrieve the data, that is outside the call. You can query the table with just a select count(*) from... With the same from and where clauses to get the number of records. But that still ...

28. Hibernate query is called twice???    coderanch.com

29. Regarding Hibernate Query    coderanch.com

Hello Experts, Thanks for Reading and Solving this Problem. My question is: for eg. get all the records from single Table: hibernate query is : from

that's fine. How can I connect two tables and get the results. Pls give me some idea. Thanks _________________ A.Edward Durai "The things which are impossible with men are possible with God."

30. Hibernate query    coderanch.com

Hello, Im having a problem makin an HQL. I need to instantiate a Value Object getting the value from another. I have VO1 and VO2. VO1 has a var Long VO2, wich is its Id. So I make a constructor on VO1: public VO1(Long id, String vo2Name){ setId(id); setVo2Name(vo2Name); } I want to get the name from VO2 and Id from ...

31. Query Regd Hibernate !    coderanch.com

32. query on Hibernate    coderanch.com

I am facing the problem when i am trying to fetch the data from database using stored procedure and we are using oracle as a database. i am posting my error below. please check the error and give me a solution ASAP. it's urgent for me.... Dec 26, 2006 11:43:29 AM org.hibernate.impl.SessionFactoryObjectFactory addInsta nce INFO: Not binding factory to JNDI, no ...

33. Hibernate query    coderanch.com

Hi All i was using Hibernate tutorial to learn Hibernate. I had created the database table mentioned as 'Book' in the microsoft access. For that i am getting this error.I found this error comes when the MS Access does not support datatypes as of mentioned in the SQL query. I am not sure what datatype to mention the O-R mapping file ...

34. query about hibernate methods    coderanch.com

35. Hibernate second query    coderanch.com

Hey, If we have the following references (eager): A ->B ->C ->D Hibernate will generate one query with left outer join for all hierarchies of each reference. The result is a crazy query that cause to oracle to crash. I wonder if there is a configuration to hibernate to fetch A with all the references, but in few steps and not ...

36. HIbernate Made easy Query    coderanch.com

I haven't done too much work with JDO, so I can't really expertly compare. JDO seemed to have alot of traction a few years ago, but its star has seemed to have faded, and I don't hear too much about it these days. Of course, I am in a Hibernate charged arena, so I'm probably biased. As far as Hibernate goes, ...

37. Queries on Hibernate?    coderanch.com

Dear Members, I have the below set of queries. 1> Why are we using Hibernate to interact with DB ? 2> Advantages of Hibernate ? 3> Disadvantages of Hibernate,If any.? 4> Suppose i have 2 tables ,customer table and customer_details table how will i prepare my .hbm.xml file for the same.? Help provided for the answers will be highly appreciated -- ...

38. Putting nulls in hibernate 2 query    coderanch.com

39. Hibernate queries    coderanch.com

40. Hibernate: Query with many-to-many    coderanch.com

Hi everybody, can someone explain me how to write a query about a many-to-many relation? I have the following classes: Person and Category. A person can habe many categories. In Person, there is a set called categories, and in Category, there is a set with the name persons. The primaryKey of Category is called categoryId. Now, I want to get all ...

42. hibernate either / or query?    coderanch.com

43. JPA Query    coderanch.com

Hi , I am of the view that JPA may be used for standalone applications (i.e. even without a server(web/application)), dragged along by this belief I ventured along to make an application I made an entity class :Cabin package com.titan.domain; import javax.persistence.*; @Entity @Table(name="CABIN") public class Cabin implements java.io.Serializable{ private int id; private String name; private int deckLevel; private int shipId; ...

44. Hierarchial query using hibernate    coderanch.com

well yes there is, Off the bat here we go ... so you've got say an ASSOCIATE table which goes like this: CREATE TABLE ASSOCIATE ( ID NUMBER PRIMARY KEY , NAME VARCHAR2(25) , PARENT_ID NUMBER ) Run an alter table by adding foreign key constraint ... PARENT_ID references ASSOCIATE(ID). PARENT_ID for ROOT (the CEO of an organization for example, (that ...

45. Querying in JPA    coderanch.com

46. Hibernate Query    coderanch.com

48. Use custom query on JPA    coderanch.com

Hi to all, i'm facing a problem with an application that i'm developing, it works with struts 2.1.8 and Hibernate JPA with database MySQL. My problem is when i want to make a complex query, specifically my query (SQL syntax) is this: SELECT PRV.NOMBRE AS nombreProveedor, COUNT(PRV.IDPRV) AS cantTransacciones, SUM(MONTO) AS montoTransacciones FROM Proveedores PRV, Movimientos_Distribuidores MDS WHERE PRV.IDPRV = MDS.IDPRV ...

49. Hibernate Query    coderanch.com

50. Correctness in hibernate query    coderanch.com

51. Hibernate Query Doubt    coderanch.com

Hi , i have an entity class which has the fields firstname and lastname in the string format. I am writing an hibernate query to select the first name and last name from the particular table . I am printing the result list returned by the query My particular selection for the table fetches four row in the table so the ...

52. Query about JPA & Hibernate    coderanch.com

Hello every one, I am new to Hibernate & JPA, and also i've worked on EJB2.x, where we'd called the session beans/entitybeans through 'lookup' statements in servlet. now i want to know how can i call an EJB3 entity from a servlet, i've tried a lot created the entity class that handles a particular database table, but does not know the ...

53. query using hibernate creteria    coderanch.com

55. why this query doesn't work ?    forum.hibernate.org

56. MSAccess Queries    forum.hibernate.org

Author Message si031006 Post subject: MSAccess Queries Posted: Tue Dec 01, 2009 8:04 am Newbie Joined: Tue Dec 01, 2009 7:51 am Posts: 1 I have an Access Database. My connection is well established, but I have troubles using the following code: Code: this.setFORMULARNAME(fensterName); this.setUSERNAME(userName); Session sess=this.datenbank.databaseOpen(); ...

57. How to query page by page with Hibernate    forum.hibernate.org

Hi, I am using Struts+Spring+Hibernate. I have a MySQL table tb_ext, the pesistent object is TbExt as following: public class TbExt implements java.io.Serializable { // Fields private Long extId; private String extNumber; private String extBox; private String extStatus; private String extUser; private String extPassword; private String extPrivateip; private String extDescription; ... } I'd like to do some query like sql string ...

58. Understanding how to use complicated queries    forum.hibernate.org

Hi! I have the following query to execute: select sum(price) from spot where job_id=? and id in (select id from status where job_id=? group by spot_event_id) i have the following objects: spot status Should i create the query with Query query = session.createQuery? as well, what does it mean setCacheable on the query?when can i flush this cacheable?

59. how get query before execute    forum.hibernate.org

60. Howto make Hibernate re-use already executed queries?    forum.hibernate.org

Hi, I've a quite complex piece of buissness-logic which executes quite a lot of database queries and because of that is painfully slow. What I've done in some areas is to replace database-queries with HashMaps, fetching all data at the beginning into a HashMap, and looking up the actually needed result by key. However thats a really bad thing for code-quality ...

61. Calculating working hours query in hibernate    forum.hibernate.org

Hello, Code: SELECT sql_calc_found_rows gstime, MAX(stoptime) ...

62. Query    forum.hibernate.org

63. Hibernate Query    forum.hibernate.org

64. Querying ElementCollections    forum.hibernate.org

65. Query within iteration slows down    forum.hibernate.org

Hi Hibernate Users, i've a question regarding a query execution which is located within a loop. Imagine following scenario. Code: List allSo = new ArrayList(); while(resultSet.next()){ Long someColumnValue = result.getLong("COLUMN_NAME"); SomeObject so = (SomeObject) em.createNamedQuery("getSomeObjectBySomeColumn").setParameter("someColumn",someColumnValue).getSingleResult(); allSo.add(so); } Within this loop the query execution time slows down. The first time ...

66. how to execute this query in hibernate    forum.hibernate.org

67. Is it possible to execute query in background with Future?    forum.hibernate.org

Hi, I know that the EntityManager is not threadsafe. What I wondered if I can execute using Future and AsyncResults to execute querys in parallel. Is it possible? Or maybe that if the queries share the same EntityManager, one of the executions close the connection associated to the others querys? Lot of thanks, Marcial

68. Query won't work    forum.hibernate.org

69. Hibernate equivalent of Connect By Prior query    forum.hibernate.org

Hello, I am working with a tree structure, where a single element can have multiple children, each of which can have multiple children up to a maximum of 10 levels. I am trying to effectively fetch an object containing Level and the primary key using which, I am querying the database. My query should return the entire hierarchy for any element ...

70. Query Using a Set    forum.hibernate.org

71. Can anyone tell why is this query not valid?    forum.hibernate.org

Hello! I have criteria query that, when executed, results the following exception thrown: Code: java.lang.IllegalArgumentException: org.hibernate.QueryException: illegal syntax near collection: id [select generatedAlias0.permissions from temp.package.commons.user.Role as generatedAlias0 where generatedAlias0.id=2L] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1222) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1168) at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:320) at org.hibernate.ejb.criteria.CriteriaQueryCompiler.compile(CriteriaQueryCompiler.java:227) at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:437) at temp.package.dao.impl.DefaultDAOService.getProperties(DefaultDAOService.java:585) The id ...

72. Query whit hibernate using >    forum.hibernate.org

Hello, My name Salvo, i have one problem with one query hibernate. I have to implement one query in one table "User". In this table, there are user with one field "age" and i look all record from 20 Age. With normal SQL exist command < or >, in hibernate? Thanks and sorry for my inglish.

73. Query.setReadOnly(true)    forum.hibernate.org

Hi, Just wanted to get my concept clear here . If we load an object through Query Interface and set ReadOnly attribute to true, does Hibernate never dirty check the object in that session ? Or only for the instance which we have loaded For example : If i loaded one object with ReadOnly flag as true and read some information ...

74. Translate query    forum.hibernate.org

SELECT * FROM T_PROVINCIA A WHERE A.IDE_REG IN (1,2,3,4) AND A.IDE_PRV IN (SELECT B.IDE_PRV FROM T_PROVINCIA B ...

75. Noob Query    forum.hibernate.org

I am trying to setup a Many-To-Many relationship using annotations. here are my entities Code: @Entity public class Publisher{ @Id public int id; public String name; } @Entity public class PublisherBook{ @Id ...

76. Using a query with lower()    forum.hibernate.org

String sql = "FROM BatchId b " + "WHERE lower(b.term) IN (:ids)"; Query q = sessionFactory.getCurrentSession().createQuery(sql); q.setParameterList("ids", idSet); ...

77. could not exute query    forum.hibernate.org

Newbie Joined: Fri Feb 18, 2011 7:35 am Posts: 1 hi, i have written below query System.out.println("this is ssclients id from ssclients----------------"+clientid);---->here i am getting clientid sstrailslist=entityManager.createQuery("select sstr from SsTrails sstr where sstr.ssClients.clientId="+clientid).getResultList(); for sstrailslist i have taken setters and getters in action class and those methods are also pasted into interface related to action class then i am getting below ...

78. Hibernate executes too many queries...    forum.hibernate.org

Newbie Joined: Thu Mar 31, 2011 4:10 pm Posts: 3 Hi, I'm working for the first time with Hibernate and I'm having some query problems. When I execute a simple retrieve with my DAO : Code: @Override public SortedSet getAllSortedWithLocalized() { SortedSet results = new TreeSet(); ...

79. @query    forum.hibernate.org

Hi guis i'm new i need hel for a query i have two table created by hibernate from java Date Object and type TIMESTAMP now i need to retrive data with a query than match only the time part (HH:mm) of the the SQL column the query i use is @NamedQuery(name ="findAppuntamentiBySportelloDataSlot", query = "from Appuntamento a where (a.sportello.idSportello = :idSportello ...

80. Hibernate SaveOrUpdate query    forum.hibernate.org

Hi, I have one employee table contains empname.deptname and emp address. of which empname and deptname is my composite primary key.In the view I am displaying the data of emps of perticular department. Now I add some emps and may remove from the view and on click of save button changes should reflect to database. I am doing this using hibernate. ...

81. HIBERNATE query stack overflow    forum.hibernate.org

82. Query Perfomance    forum.hibernate.org

Hello, I wanted to share something I found as solution for much better query execution performance. It is for SQL queries in general but I worked with Hibernate and JPA and have such query example. It was about finding available `Organization`-s which were not already assigned to an `Application` but result must be filtered also by User security from active UserGroup ...

83. Hibernate Query with NVARCHAR    forum.hibernate.org

84. IllegalArgumentException during query    forum.hibernate.org

Was wondering if anyone can see an obvious problem with my query that does not run. I have a component table and a ptsdata table. The component table has a FK to the ptsdata table. I am trying to query the component table where the ptsdataid = "some value". The generated query is correct and selects the proper records. But it ...

85. Hibernate JPA query    forum.hibernate.org

Hello all, Can anyone please help me with this query. The scenario is i need to get data from two different tables and show them in jtable. For this i have used secondary table annotation to create a single class for the purpose. Now i need to create a query for this but i am having trouble with it. The query ...

86. Making a query with kind of 'not exists'    forum.hibernate.org

Ok, still pending with a non-complete solution. This request is ok but if content has at least one tag not in tagsExcluded list, it matches the request. How be sure to avoid that? Could you correct : Restrictions.not(Property.forName("tags.id").in(tagsExcludedCriteria)) Code: final DetachedCriteria criteria = DetachedCriteria.forClass(Content.class, "c"); if (!tagsExcluded.isEmpty()) { ...

87. How to build statistical query?    forum.hibernate.org

Hi all, I have a abstract BaseEntity(annotated with MappedSuperclass), and this parent class has properties as below: @Temporal(TemporalType.TIMESTAMP) @Column(name = "create_time") private Date createTime; @Temporal(TemporalType.TIMESTAMP) @Column(name = "last_update_time") private Date lastUpdateTime; and as you expected there are methods annotated with PrePersist and PreUpdate. I want to count the number of rows of a derived entity from the above class with respect ...

88. Can I change the 'laziness' setting at query level?    forum.hibernate.org

Hi, Ever since Hibernate 3, associations have been lazy by default. I have a code base with a pretty extensive set of data objects, with virtually every association modeled as non-lazy, and I'm looking in to changing that because I want to interact with Hibernate in a more standard way. The reason we do this is because there's two basic use ...

89. PersistentEnum, Querying    forum.hibernate.org

90. StackOverflow upon querying in 2.1beta4    forum.hibernate.org

Hi, I noticed, that when I execute the following stuff using 2.1beta4: StringBuffer queryString = new StringBuffer(); queryString.append( "select " + "distinct b, " + "m.anlegenDatum " + "from " + "BasisArtikel b, " + "elements(b.mandantArtikelSet) m " + "where " + "m.anlegenDatum >= :datum and " + "m.anlegenDatum is not null " + "order by m.anlegenDatum"); Query query = session.createQuery(queryString.toString()); ...

91. Custom query    forum.hibernate.org

I am new to Hibernate and Hibernate development so I would like to appologize for anything I may do wrong (and for my English as well :) ) I have a requirement to execute custom queries. I couldn't find an appropriate solution except changing Hibernate itself. Thus I added new method to Session class: Code: public List callSQL(Class persistentClass, String sql) ...

92. what is wrong with the query?    forum.hibernate.org

oops, I forgot the stack trace: [junit] at net.sf.hibernate.hql.FromParser.token(FromParser.java:102) [junit] at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) [junit] at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) [junit] at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) [junit] at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:146) [junit] at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:133) [junit] at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:352) [junit] at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:330) [junit] at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1368) [junit] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1332) [junit] at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) [junit] at TestTEMP.testX(TestTEMP.java:149) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) Obviously, I can make that exact query simplier, but ...

93. Proxy and Query    forum.hibernate.org

session = fac.openSession(); Query q = new Query("from MyClassWithProxy ..."); session.close(); Iterator it = q.iterate(); while (it.hasNext()) { MyClassWithProxy c = (MyClassWithProxy) it.next(); c.getAtribute() ///// Exception initializing proxy .. net.sf.hibernate.HibernateException: Could not initialize proxy (session closed) } If my class doesn't use a proxy I can iterate the results without problem even after close the session, otherwise if my class uses ...

94. Why doesn't query compile?    forum.hibernate.org

Hello, I've been looking all over the manual, FAQ and forum, but I can't find an answer to this problem: I have a class Subscription with (amonst others) a property number. I try to find a subscription with this query: "from Subscription as subs where subs.number = ?". In the log I get a "unexpected query compilation problem". Using session.find() or ...

95. How do I get rid of the subscrip0_ prefixes in my query?    forum.hibernate.org

(Using MySQL) The query builder prefixes all my fields with all these subscrip thingies. My guess is that these are placeholders for the schema. I guess that I could use the hibernate.default_schema property set to the schema name, but I don't want to do that, I want a clean query and keep the name of the schema restricted to the database ...

96. it simply stops querying! Why?    forum.hibernate.org

97. Does Hibernate support direct PL/SQL query? How?    forum.hibernate.org

98. Accessing translated queries    forum.hibernate.org

Simple, performance. What I have designed is a report engine that uses business objects, with relationships etc. This is fine and dandy when designing the report, but I would much prefer the "final" query to be JDBC only, so I will avoid the configuration startup and query translation at runtime. Hibernate at design time, jdbc at run time :) However, I ...

99. Query Probleme    forum.hibernate.org

Please take a look at my query. Hibernate always throws a ClassCastException, but the generated SQL-Query is ok the query: Code: from de.sigel.business.projektmanager.projekt.ProjektImpl as projekt join projekt.planKosten as planKosten where planKosten.belegNr = '12345' and the hibernate mapping: Code: ...

100. what is wrong with this query ?    forum.hibernate.org

net.sf.hibernate.QueryException: unexpected token: as [select distinct vo.effFrmDt from CreditsVO as vo where vo.taxAuthorityId=55 order by vo.effFrmDt] at net.sf.hibernate.hql.FromParser.token(FromParser.java:97) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java(Compiled Code)) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:146) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:133) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:352) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:330) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1368) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1332) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1322) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1314) at com.esm.common.dbwrappers.ESMSession.find(ESMSession.java:124) at com.esm.admin.tax.taxauthority.credits.dao.ESMTaxCreditsDAO.fetchAll(ESMTaxCreditsDAO.java:113) at com.esm.admin.tax.taxauthority.credits.action.ESMTaxCreditsAction.getFromDates(ESMTaxCreditsAction.java:428) at com.esm.admin.tax.taxauthority.credits.action.ESMTaxCreditsAction.getDates(ESMTaxCreditsAction.java:131) at java.lang.reflect.Method.invoke(Native Method) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:480) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at ...