Hibernate version:3.0 beta 6
Mapping documents:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hi Everybody,
I have tried using the @JoinTable but even this does not work.
Code:
@OneToMany(cascade={CascadeType.PERSIST}, fetch=FetchType.EAGER)
@JoinTable(
table=@Table(name="ShowAssets"),
joinColumns = { @JoinColumn( name="showid") },
inverseJoinColumns = @JoinColumn( name="id")
)
@IndexColumn(name ="showassetid")
public Set <AudioFile> getAudioAssets() {
return audioAssets;
}
public void setAudioAssets(Set <AudioFile> audioAssets) {
this.audioAssets = audioAssets;
}
Well can anybody suggest how the OneToMany mechanism works at the Database level.
Is is that the record is automatically inserted into the JoinTable as soon as the records in the Mapped Tables
Is is that we have to explicitly insert the record
One more thing is that.
I am using Single Table Per Class Hierarchy and I am mapping to the Child object reference for the Multiplicity.
Can somebody please suggest how to achieve this...???
I have tried using all the CascadeType attributes but all the effort went in vain.
Thanks In Advance,
Manjith Kumar.