[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-338) Query and @Column arround getter
Cédric Chantepie (JIRA)
noreply at atlassian.com
Wed Feb 27 14:11:33 EST 2008
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29606 ]
Cédric Chantepie commented on EJB-338:
--------------------------------------
I''ve asked on IRC.
I may be wrong but according JPA specs @Column annotation could be added on field or on getter in equivalent way, so why should it be different for query ?
> Query and @Column arround getter
> --------------------------------
>
> Key: EJB-338
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-338
> Project: Hibernate Entity Manager
> Issue Type: Bug
> Components: EntityManager
> Affects Versions: 3.3.1.GA
> Environment: BEA JRockit(R) (build R26.4.0-63-63688-1.5.0_06-20060626-2259-linux-ia32, )
> Reporter: Cédric Chantepie
>
> When binding property with @Column annotation arround corresponding getter query "cannot resolve property", whereas all other persistence features (EntityManager.{persist,find,...}) properly supports it.
> Just moving annotation to the private field fix this issue, but in some case you really want to mapped property from its getter and not from private (protected) field.
> Annotation binding (causing issue) :
> [...] class ProcessStateEntity {
> [...]
> @Column(name="col")
> public Calendar getOccured() { ... }
> [...]
> }
> Query exception :
> org.hibernate.QueryException: could not resolve property: occured of: xxx.ProcessStateEntity [SELECT s.occured FROM xxx.Pr
> ocessStateEntity s]
> at org.hibernate.persister.entity.AbstractPropertyMapping.propertyExcept
> ion(AbstractPropertyMapping.java:44)
> at org.hibernate.persister.entity.AbstractPropertyMapping.toType(Abstrac
> tPropertyMapping.java:38)
> at org.hibernate.persister.entity.AbstractEntityPersister.toType(Abstrac
> tEntityPersister.java:1358)
> at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElemen
> tType.java:279)
> at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:386)
> at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:566)
> at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:241)
> at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:188)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list