Ahoj.
Laborujem trosku s Hibernate a $SUBJ. V principe mi ide o toto:
Mam niekolko tabuliek, ktorych primarnym klucom su vzdy 2 stlpce ( int, int )
a tymito integermi su prepojene. K tomu som si vyrobil ekvivalent pre
hibernate:
@Embeddable
public class IntIntPKey implements Serializable {
private int mediaId;
private int fileId;
...
}
Moja otazka znie, ci mozem tuto class-u pouzivat ako id pre vsetky tabule,
alebo musim pre kazdu tabulu vyrobit novu.
Priklad:
@Entity
@Table(name = "E1")
public class E1 implements Serializable {
@EmbeddedId
protected IntIntPKey id;
...
}
@Entity
@Table(name = "E2")
public class E2 implements Serializable {
@EmbeddedId
protected IntIntPKey id;
...
}
@Entity
@Table(name = "E3")
public class E3 implements Serializable {
@EmbeddedId
protected IntIntPKey id;
...
}
... a tak dalej ...
Predpokladam, ze by to nemusel byt problem..
Diky
--
Dusan
... tykajte mi