Following up on this
thread, I can't seem to the correct one-to-one mapping via hibernatedoclet: The error I got:
Quote:
net.sf.hibernate.MappingException: could not instantiate id generator
at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:82)
at net.sf.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:80)
at net.sf.hibernate.cfg.Configuration.iterateGenerators(Configuration.java:413)
at net.sf.hibernate.cfg.Configuration.generateDropSchemaScript(Configuration.java:461)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:58)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:297)
Caused by: net.sf.hibernate.MappingException:
param named "property" is required for foreign id generation strategy
at net.sf.hibernate.id.ForeignGenerator.configure(ForeignGenerator.java:64)
Excerpt from the xdoclet tags between class Foo and Bar:
Code:
public class Foo {
/**
* @hibernate.id
* unsaved-value="null"
* generator-class="native"
* @return Long
*/
public Long getId() {
return id;
}
/**
* @hibernate.one-to-one
* class = "org.babi.Bar"
* cascade = "save-update"
*/
public Bar getBar() {
return bar;
}
---o<--snip----
}
public class Bar {
/**
* @hibernate.id
* unsaved-value="null"
* generator-class="foreign"
*
*/
public Long getId() {
return id;
}
/**
* @hibernate.one-to-one
* class = "org.babi.Foo"
* constrained = "true"
*/
public Foo getFoo() {
return foo;
}
---o<--snip----
}
What is the mistake ? Thanks.
Regards,
alistair