Hi,
I currently added @Formula annotation to one of my entities. I am using the hibernate entity manager configured by spring. Actually I am using the code generated by spring roo. (app context snippets below).
I added a derived property as follows
private String tester; @Formula("( select md5('hallo') from dual )") public String getTester() { return tester; }
If I look at the generated SQL queries, my formula is irgnored ;-(
Is there something I am missing ?
Regards, Dirk -------------------------------------------------------------
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory"> <property name="dataSource" ref="dataSource"/> </bean>
and this persistence.xml
<persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>de.test.domain.model.AbstractItem</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/> </properties> </persistence-unit>
|