Hi,
the mapping of the tables looks like following:
Code:
@Entity
@Table(name = "PROZESS")
public class Process extends BaseEntity {
@Id
@Column(name = "PROZESS_ID")
private String id;
@OneToMany
@JoinTable(name = "TEXT2PROZESSE",
joinColumns = { @JoinColumn(name = "MAP_ID") },
inverseJoinColumns = { @JoinColumn(name = "TEXT_ID", rerencedColumnName = "TEXT_ID") })
private List<TextResource> names;
}
@Entity
@Table(name = "TEXT_RESSOURCE")
@BatchSize(size = 50)
public class TextResource extends BaseEntity {
@Id
@Column(name = "ROWID")
private String id;
@Column(name = "TEXT_ID")
private Long textId;
@Column(name = "SPRACHE")
@Type(type = "LocaleType")
private Locale locale;
@Column(name = "TEXT")
private String text;
}
The entity model comes from a legacy system. As you can mention the TextResources are used for translation. Between Process and TextResource a mapping table is used (1:1 Process - Mapping, 1:* Mapping - TextResource).
If two or more Processes share one text resource the first record (id = 5) loads the TextResources correctly (of course, within one session):
5 ... 5850 de Nachanmeldung | 5850 en Subsequent Application | 5850 fr Demande ultérieure |
But the second one (id = 28) only gets the french translations - 3 times:
28 ... 5850 fr Demande ultérieure | 5850 fr Demande ultérieure | 5850 fr Demande ultérieure
I hope someone can help me. If have no idea, whether the are errors in configuration or there is a bug in hibernate.
Hibernate version: 3.2.5.ga
Name and version of the database you are using: Oracle 9i
Thanks in advance,
best regards,
michi