hql « Column « JPA Q&A

1. Getting changes in one column of an historical table    stackoverflow.com

I have a table which stores historical data. It's mapped to an Entity with the following fields (I use JPA with Hibernate implementation):

public class ItemHistory{
    private Integer id;


2. How to change to case of a column to Upper in HQL Hibernate    stackoverflow.com

I want to change a column from a table to uppercase before using like and filtering what is the keyword in HQL? here's my query

WHERE abc.id = ?
And upper(abc.description) ...

3. Using Hibernate HQL, how can I add a column to a table?    stackoverflow.com

Following a recent question, I would like to add an int column to a table without adding an int member to the class. This will only be used when loading/saving ...

4. Hibernate How to add a column in a middle table    stackoverflow.com

Here's the details. I have 2 entity tables with one to many relationship. First, Exam class has many Category class. Hibernate generates this tables

- Id
- Name 
- Category
- Id
- Name
- Exam_Id
- Category_Id
I need ...

5. org.hibernate.hql.ast.QuerySyntaxException: unexpected token: com near line 1, column 6    coderanch.com

I have facing following Error please any one help me? org.hibernate.hql.ast.QuerySyntaxException: unexpected token: com near line 1, column 6 [FROM com.ssc.soareg.db.infomodel.ConfigurationHBM config WHERE config.name = 'security.auth.url'] org.hibernate.hql.ast.QuerySyntaxException: unexpected token: com near line 1, column 6 [FROM com.ssc.soareg.db.infomodel.ConfigurationHBM config WHERE config.name = 'security.auth.url'] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:284) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94) at ...

7. multi-column id and HQL    forum.hibernate.org

Hello I try to compare a relation with an already-loaded persistent object in HQL, where ids of the objects are multi-column ids (hibernate 2.0.3). Here is the declaration of id (no composite-id, because need to have a custom type to manage my id and composite-id do not have a type attribute) :

8. HQL generates SQL with mismatched column name?    forum.hibernate.org

I have a hibernate id named "hid". It is a Long. I have another column named "id" that I use in my app. It is a String. It seems that HQL is incorrectly mapping the column named "id" to the hibernate id column "hid" in the SQL that it generates. That is, this code: ----- // DataMapper is a convenience class ...

9. subselect in HQL that returns multiple columns    forum.hibernate.org

10. "Operand should contain 2 column(s)" after HQL que    forum.hibernate.org

Hi all, I am trying to load some data from our database and use the following HQL string: "FROM SeminarEventParticipant sep WHERE sep.user.id=?". The problem is, that I always get the error message "Operand should contains 2 column(s)". I have to say that we use a special Id class which contains two values: UID class: - creation date (cd) - long ...

11. HQL Joining with non-primary key columns    forum.hibernate.org

Hi, I have the following HQL FROM Object1 obj1 INNER JOIN obj1.set1 set1 INNER JOIN obj1.eqTextTs set2 WHERE (obj1.hideQuestion = 0) AND (set1.id = :policy) AND (obj1.secondId = 0) AND (set1.comp_id.id = :id OR set1.comp_id.id = - 1) ORDER BY obj1.num The relationship refered to as set1 is joing to obj1 with its primary key, how ever this is not what ...

13. How to add two columns in HQL?    forum.hibernate.org

How do you add two columns in HQL?I want to do this : Select principalamount + Interest from person How do I write it in HQL? I used the + operator and I get the error :- ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException: null java.lang.NullPointerException at org.hibernate.dialect.Dialect$3.getReturnType(Dialect.java:93) at org.hibernate.hql.ast.util.SessionFactoryHelper.findFunctionReturnType(SessionFactoryHelper.java:376) at org.hibernate.hql.ast.tree.AggregateNode.getDataType(AggregateNode.java:21) at org.hibernate.hql.ast.tree.BinaryArithmeticOperatorNode.initialize(BinaryArithmeticOperatorNode.java:29) at org.hibernate.hql.ast.HqlSqlWalker.prepareArithmeticOperator(HqlSqlWalker.java:1018) at ...

15. HQL: Hibernate "getting" column name not in genera    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 ] HQL: Hibernate "getting" column name not in genera Page 1 of 1 [ 1 post ] ...