-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Attribute/column name "end" has special meaning?
PostPosted: Fri Jun 18, 2010 8:52 am 
Newbie

Joined: Fri Jun 18, 2010 8:31 am
Posts: 1
I have an entity with two Date fields. One of them is named "end"

Code:
public class OrganizationMembership {
....
    @Temporal (value = TemporalType.TIMESTAMP)
    @Column(nullable = false, updatable = true)
    private Date  startDate;

    @Temporal (value = TemporalType.TIMESTAMP)
    @Column(nullable = false, updatable = true)
    private Date  end;
....
}

If I execute JP-QL request like below
Code:
entityManager.createQuery("select om from OrganizationMembership as om "
   + "WHERE om.startDate <= :date AND :date <= om.end ")
   .setParameter("date", date).getResultList();

I see the following in the log
Code:
select organizati0_.ID as ID9_, end as end9_, organizati0_.startDate as startDate9_
from OrganizationMembership organizati0_
where organizati0_.startDate<=? and ?<=end

please take a notice that in the last condition "? <= end" is used instead of fully qualified name "tableName.fieldName"
in the selected columns list it is defined as "end as end9_"

Is it a problem of SQL logging or "end" is some reserved field for the hibernate ?

I also use Hibernate-Filters on that Entity with same condition, it works the same way here
"select organizati1_.user from OrganizationMembership organizati1_ where organizati1_.startDate <= ? AND ? <= end"
After renaming the "end" to the "endDate" I see the fully-qualified field-name ${table.field} in the log.

Environment: Hibernate 3.5.3-Final but on previous versions I experienced the same issue. DB - MySQL 5.1
JBoss-Seam 2.2.1-CR1, Tomcat-6


Top
 Profile  
 
 Post subject: Re: Attribute/column name "end" has special meaning?
PostPosted: Thu Sep 03, 2015 3:05 am 
Newbie

Joined: Thu Sep 03, 2015 3:02 am
Posts: 1
I have exactly the same issue. We are trying to migrate from 3.2.6 to 3.5.6. We cannot rename the column at this moment, so we need other solution.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.