Hi !
I found out the answer by myself.
Maybe someone else will find the answer useful:
The default naming strategy does not regard the path thru the embedded classes
to the actual entity column.
Hibernate provides an alternativ naming strategy handler which can be activated
in persistence.xml using the line:
<property name="hibernate.ejb.naming_strategy"
value="org.hibernate.cfg.DefaultComponentSafeNamingStrategy"/>
Unfortunately this out of the box naming strategy class produces some SQL
grammar (mysql) errors in my case.
So I had to implement my own strategy,
activated using the line above replaced with the class name by my own strategy
class.
(Sorry, I can not publish the entire class here, because I haven't got the
legal rights on it)
For example the method propertyToColumnName could be implemented like this:
| public String propertyToColumnName(String name) {
| StringBuffer buf = new StringBuffer(name.length() );
| String[] parts = name.split("\\.");
| for (int i = 0; i < parts.length; i++) {
| if (i > 0) {
| buf.append("$");
| }
| buf.append(parts.toLowerCase());
| }
| return buf.toString();
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4081966#4081966
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4081966
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user