4,6 → 4,7 |
|
import java.util.HashSet; |
import java.util.Set; |
|
import javax.persistence.Column; |
import javax.persistence.Entity; |
import javax.persistence.FetchType; |
17,51 → 18,65 |
*/ |
@Entity |
@Table(name = "object_type", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "name")) |
public class ObjectType implements java.io.Serializable { |
public class ObjectType implements java.io.Serializable |
{ |
/** |
* ObjectEntity type ID for a term |
*/ |
public static final int TERM = 1; |
|
private int objectTypeId; |
private String name; |
private Set<Object> objects = new HashSet<Object>(0); |
private int objectTypeId; |
private String name; |
private Set<ObjectEntity> objects = new HashSet<ObjectEntity>(0); |
|
public ObjectType() { |
} |
public ObjectType() |
{ |
} |
|
public ObjectType(int objectTypeId) { |
this.objectTypeId = objectTypeId; |
} |
public ObjectType(int objectTypeId) |
{ |
this.objectTypeId = objectTypeId; |
} |
|
public ObjectType(int objectTypeId, String name, Set<Object> objects) { |
this.objectTypeId = objectTypeId; |
this.name = name; |
this.objects = objects; |
} |
public ObjectType(int objectTypeId, String name, Set<ObjectEntity> objects) |
{ |
this.objectTypeId = objectTypeId; |
this.name = name; |
this.objects = objects; |
} |
|
@Id |
@Column(name = "object_type_id", unique = true, nullable = false) |
public int getObjectTypeId() { |
return this.objectTypeId; |
} |
@Id |
@Column(name = "object_type_id", unique = true, nullable = false) |
public int getObjectTypeId() |
{ |
return this.objectTypeId; |
} |
|
public void setObjectTypeId(int objectTypeId) { |
this.objectTypeId = objectTypeId; |
} |
public void setObjectTypeId(int objectTypeId) |
{ |
this.objectTypeId = objectTypeId; |
} |
|
@Column(name = "name", unique = true, length = 45) |
public String getName() { |
return this.name; |
} |
@Column(name = "name", unique = true, length = 45) |
public String getName() |
{ |
return this.name; |
} |
|
public void setName(String name) { |
this.name = name; |
} |
public void setName(String name) |
{ |
this.name = name; |
} |
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectType") |
public Set<Object> getObjects() { |
return this.objects; |
} |
@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectType") |
public Set<ObjectEntity> getObjects() |
{ |
return this.objects; |
} |
|
public void setObjects(Set<Object> objects) { |
this.objects = objects; |
} |
public void setObjects(Set<ObjectEntity> objects) |
{ |
this.objects = objects; |
} |
|
} |