|Re: Hibernate annotation ignored in teneo [message #1691210 is a reply to message #1691196]
||Fri, 03 April 2015 11:47
| Victor Roy
Registered: May 2013
I am replying to my own question, because I solved the problem and I thought that someone else might need it.|
1. The attribute has to be defined as follows:
* @model default="0" derived="true" ordered="false"
* annotation="teneo.jpa appinfo=' @Formula(\"(select count(*) from Employee o where o.parent_e_id=e_id)\")'"
In other words, the attribute
must not be transient (false), for otherwise it is completely ignored when teneo generates the mapping (this is why the annotation is ignored)
must be changeable (so that the value of the attribute can be set)
Also the SQL statement should be in brackets since hibernate will generate a statement such as
select field1, field2, (select count (*) from Employe o where o.parent_e_id_e_id) as fieldname from table1 ....
[Updated on: Fri, 03 April 2015 11:48]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01919 seconds