Fixed DMP and User mappings

This commit is contained in:
Nikolaos Laskaris 2017-10-19 15:31:36 +03:00
parent 67caeffa54
commit 08a4abc9ff
3 changed files with 108 additions and 95 deletions

View File

@ -88,12 +88,21 @@ public class DMP implements Serializable {
private Set<Researcher> researchers; private Set<Researcher> researchers;
// @OneToMany(fetch = FetchType.EAGER) @OneToMany(fetch = FetchType.EAGER)
// @JoinTable(name="\"UserDMP\"", @JoinTable(name="\"UserDMP\"",
// joinColumns={@JoinColumn(name="dmp", referencedColumnName="\"ID\"")}, joinColumns={@JoinColumn(name="dmp", referencedColumnName="\"ID\"")},
// inverseJoinColumns={@JoinColumn(name="user", referencedColumnName="\"ID\"")} inverseJoinColumns={@JoinColumn(name="usr", referencedColumnName="id")}
// ) )
// private Set<UserInfo> users; private Set<UserInfo> users;
public Set<UserInfo> getUsers() {
return users;
}
public void setUsers(Set<UserInfo> users) {
this.users = users;
}
public UUID getId() { public UUID getId() {
@ -177,13 +186,7 @@ public class DMP implements Serializable {
} }
// public Set<UserInfo> getUsers() {
// return users;
// }
//
// public void setUsers(Set<UserInfo> users) {
// this.users = users;
// }
public String toString() { public String toString() {
try { try {

View File

@ -1,76 +1,77 @@
//package entities; package entities;
//
//import java.io.Serializable; import java.io.Serializable;
//import java.util.UUID; import java.util.UUID;
//
//import javax.persistence.Column; import javax.persistence.Column;
//import javax.persistence.Entity; import javax.persistence.Entity;
//import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
//import javax.persistence.Id; import javax.persistence.Id;
//import javax.persistence.Table; import javax.persistence.Table;
//
//import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.GenericGenerator;
//import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
//
//import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.JsonIdentityInfo;
//import com.fasterxml.jackson.annotation.ObjectIdGenerators; import com.fasterxml.jackson.annotation.ObjectIdGenerators;
//
//@Entity @Entity
//@Table(name="\"UserInfo\"") @Table(name="\"UserDMP\"")
//@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="autoid") @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
//public class UserDMP implements Serializable{ public class UserDMP implements Serializable{
//
// private static final long serialVersionUID = -4467370784003784660L; private static final long serialVersionUID = -4467370784003784660L;
//
//
// @Id @Id
// @GeneratedValue @GeneratedValue
// @GenericGenerator(name = "uuid2", strategy = "uuid2") @GenericGenerator(name = "uuid2", strategy = "uuid2")
// @Column(name = "id", updatable = false, nullable = false, columnDefinition = "BINARY(16)") @Column(name = "id", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
// private UUID id; private UUID id;
//
// @Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL @Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
// @Column(name = "user", nullable = false) @Column(name = "usr", nullable = false)
// private UUID user; private UUID usr;
//
// @Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL @Type(type="org.hibernate.type.PostgresUUIDType") //DEPWARN dependency to Hibernate and PostgreSQL
// @Column(name = "dmp", nullable = false) @Column(name = "dmp", nullable = false)
// private UUID dmp; private UUID dmp;
//
// @Column(name = "role") @Column(name = "role")
// private Integer role; private Integer role;
//
// public UUID getId() { public UUID getId() {
// return id; return id;
// } }
//
// public void setId(UUID id) { public void setId(UUID id) {
// this.id = id; this.id = id;
// } }
//
// public UUID getUser() {
// return user; public UUID getUsr() {
// } return usr;
// }
// public void setUser(UUID user) {
// this.user = user; public void setUsr(UUID usr) {
// } this.usr = usr;
// }
// public UUID getDmp() {
// return dmp; public UUID getDmp() {
// } return dmp;
// }
// public void setDmp(UUID dmp) {
// this.dmp = dmp; public void setDmp(UUID dmp) {
// } this.dmp = dmp;
// }
// public Integer getRole() {
// return role; public Integer getRole() {
// } return role;
// }
// public void setRole(Integer role) {
// this.role = role; public void setRole(Integer role) {
// } this.role = role;
// }
//
//}
}

View File

@ -73,12 +73,21 @@ public class UserInfo implements Serializable{
@Column(name = "additionalinfo", columnDefinition = "xml", nullable = true) @Column(name = "additionalinfo", columnDefinition = "xml", nullable = true)
private String additionalinfo; private String additionalinfo;
// @OneToMany(fetch = FetchType.EAGER) @OneToMany(fetch = FetchType.EAGER)
// @JoinTable(name="\"UserDMP\"", @JoinTable(name="\"UserDMP\"",
// joinColumns={@JoinColumn(name="user", referencedColumnName="\"ID\"")}, joinColumns={@JoinColumn(name="usr", referencedColumnName="id")},
// inverseJoinColumns={@JoinColumn(name="dmp", referencedColumnName="\"ID\"")} inverseJoinColumns={@JoinColumn(name="dmp", referencedColumnName="\"ID\"")}
// ) )
// private Set<UserInfo> users; private Set<DMP> dmps;
public Set<DMP> getDmps() {
return dmps;
}
public void setDmps(Set<DMP> dmps) {
this.dmps = dmps;
}