For future reference:
config.add("CustomHibernateConfiguration", new
HibernateConfigurer() {
public void configure(Configuration configuration) {
//configuration.setProperty("hibernate.ejb.naming_strategy",
"org.hibernate.cfg.DefaultComponentSafeNamingStrategy");
configuration.setNamingStrategy(new
DefaultComponentSafeNamingStrategy());
}
},"after:Default");
...appears to work and @Embedded components now get the fieldname prefix in
the db, allowing for multiple embedded components of the same type without
DDL errors - setting the property programmatically or within
hibernate.cfg.xml doesn't appear to work. Tapestry 5.2.0-SNAPSHOT, Hibernate
3.5.2-Final. <groan>
Regards,
Jim.
-----Original Message-----
From: Jim O'Callaghan [mailto:[email protected]]
Sent: 30 June 2010 09:15
To: 'Tapestry users'
Subject: RE: Tapestry and hibernate DefaultComponentSafeNamingStrategy
I should have said that I tried:
public static void contributeHibernateSessionSource(
OrderedConfiguration<HibernateConfigurer> config,
final Session session,
@InjectService("ApplicationStateManager") final
ApplicationStateManager applicationStateManager) {
.
.
.
config.add("CustomHibernateConfiguration", new
HibernateConfigurer() {
public void configure(Configuration configuration) {
configuration.setProperty("hibernate.ejb.naming_strategy",
"org.hibernate.cfg.DefaultComponentSafeNamingStrategy");
}
});
}
Has anyone got embedded entities working with Tapestry / Hibernate with the
db column prefix that the DefaultComponentSafeNamingStrategy typically
supplies? This is going to cause a real problem for me - would be a shame
to have to do OneToOne and a separate lookup for entities with a coincident
lifespan.
Regards,
Jim.
-----Original Message-----
From: Jim O'Callaghan [mailto:[email protected]]
Sent: 29 June 2010 22:04
To: 'Tapestry users'
Subject: Tapestry and hibernate DefaultComponentSafeNamingStrategy
Is anyone using org.hibernate.cfg.DefaultComponentSafeNamingStrategy with
@Embedded entities and Tapestry? I have @EmbeddedIds working fine, with the
db data column names prefixed with <variableName_>componentField, but can't
seem to get the prefix working @Embedded - I've tried adding:
configuration.add("hibernate.ejb.naming_strategy",
"org.hibernate.cfg.DefaultComponentSafeNamingStrategy");
... in the HibernateModule that ships with Tapestry but to no avail.
Can anyone give me a steer - hopefully something obvious I'm missing?
Thanks,
Jim.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]