Fórumok

map hibernate object with liferay internal table - many to many relation

Thanasis Iliopoulos, módosítva 11 év-val korábban

map hibernate object with liferay internal table - many to many relation

New Member Bejegyzések: 4 Csatlakozás dátuma: 2012.09.03. Legújabb bejegyzések
i would like to know - if possible - how can i map a hibernate object model to an internal liferay table 'user_'.

My Hibernate Object model is:

@Entity
@Table(name = "imageviewer_crreviewprotocol")
public class CRReviewProtocol implements Serializable {

private static final long serialVersionUID = 1L;

@Id
@GeneratedValue
@Column(name = "RevProtId")
private Long revProtId;

@Column(name = "RevProtDescription")
private String RevProtDescription;

@ManyToMany(cascade = {CascadeType.ALL})
@JoinTable(name="imageviewer_revprot_features", 
joinColumns={@JoinColumn(name="RevProtId")}, 
inverseJoinColumns={@JoinColumn(name="VarId")})
private Set<crvariable> crvariables = new HashSet<crvariable>();

@ManyToMany(cascade = {CascadeType.ALL})
@JoinTable(name="imageviewer_revprot_patients", 
joinColumns={@JoinColumn(name="RevProtId")}, 
inverseJoinColumns={@JoinColumn(name="ImPatientId")})
private Set<crimagedata> crimagedata = new HashSet<crimagedata>();
Which builds a main table 'imageviewer_crreviewprotocol' and two other intermediate tables for M-N relations with two other entities.</crimagedata></crimagedata></crvariable></crvariable>


I would like to have another intermediate M-N table which will store internal (liferay) userId and RevProtId. But how am i going to map this? I have tried code like:

@ManyToMany(cascade = {CascadeType.ALL})
@JoinTable(name="imageviewer_revprot_reviewers", 
joinColumns={@JoinColumn(name="RevProtId")}, 
inverseJoinColumns={@JoinColumn(name="ReviewerId")})
//private Set<biginteger> userId = new HashSet<biginteger>(); 
//private Set<user> user = new HashSet<user>();</user></user></biginteger></biginteger>


But obviously i am missing something!

Anybody with relevant experience?
Thanasis Iliopoulos, módosítva 11 év-val korábban

RE: map hibernate object with liferay internal table - many to many relatio

New Member Bejegyzések: 4 Csatlakozás dátuma: 2012.09.03. Legújabb bejegyzések
Is there any way to set (import, or set as mapping class) liferay table user_ in hibernate configuration xml file?