Hibernate version:
Hibernate Annotations 3.3.0.GA
Hibernate 3.2.5
Mapping documents:
Annotations:
Quote:
class Extension{
@Id
public int getId() {
return getOriginal().getId();
}
@OneToOne
public Inst getOriginal() {
return orig;
}
}
Name and version of the database you are using:Oracle 10g
We have an extension type table, where there is at most one entry in the extension table per row in the original. There might be none.
The Id of the original table is thus the Id of the extension table. I also want to access the original table from the extension.
The above code is what I currently have. I tried putting the @Id on the getOriginal method, but that complains about the type of the original.
Quote:
org.hibernate.MappingException: Could not determine type for: com.Original, for columns: [org.hibernate.mapping.Column(original)]
With the above code, it forces me to create a setter for the Id on the extension table, but that does not make sense as its set by setting the original object onto the extension object.
I am probably doing this the wrong way - any tips/pointers?
Thanks in advance,
Chris[/quote]