[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4272?page=c...
]
Rodrigo Canabrava updated HHH-4272:
-----------------------------------
Attachment: testcase.zip
This test shows that formula fields being populated correctly.
Maybe, what happened when the issue was reported, was that the user attached the object to
the session, and immediatelly checked the formula field.
In this case, it is expected that the field is still not initialized. In order to make a
test case to work, evict the object, then load it again.
@Formula annotation does not set value into bean property
---------------------------------------------------------
Key: HHH-4272
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4272
Project: Hibernate Core
Issue Type: Bug
Components: annotations
Environment: HSQLDB
14:46:43,879 INFO Version:15 - Hibernate Annotations 3.4.0.GA
14:46:43,908 INFO Environment:543 - Hibernate 3.3.0.SP1
14:46:43,926 INFO Environment:576 - hibernate.properties not found
14:46:43,934 INFO Environment:709 - Bytecode provider name : javassist
14:46:43,941 INFO Environment:627 - using JDK 1.4 java.sql.Timestamp handling
14:46:44,040 INFO Version:14 - Hibernate Commons Annotations 3.1.0.GA
Reporter: Lincoln Baxter, III
Attachments: testcase.zip
Original Estimate: 1 day
Remaining Estimate: 1 day
The @Formula annotation never assigns the value of the query into the bean field. As you
can see, it is being selected, but the field never receives the value. Everything else
works fine.
@Formula("id + 4")
private int numWatchers;
A snippit of the generated SQL
select story0_.id as id9_1_, ....... story0_.id + 4 as formula0_1_, ...... where
story0_.id=?
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira