Subversion Repositories WebE

Compare Revisions

Last modification

Ignore whitespace Rev 32 → Rev 33

/trunk/src/ch/ffhs/webE/domain/Term.java
2,8 → 2,11
 
// Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1
 
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
 
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
13,7 → 16,9
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;
 
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
 
22,81 → 27,139
*/
@Entity
@Table(name = "term", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class Term implements java.io.Serializable {
public class Term implements Serializable
{
/**
* Version ID for serialization
*/
private static final long serialVersionUID = 1L;
 
private int objectId;
private Object object;
private String name;
private Set<Relationship> relationshipsForTermTo = new HashSet<Relationship>(
0);
private Set<Relationship> relationshipsForTermFrom = new HashSet<Relationship>(
0);
@Transient
private int objectId;
 
public Term() {
}
private ObjectEntity object;
private String name;
private Set<Relationship> relationshipsForTermTo = new HashSet<Relationship>(
0);
private Set<Relationship> relationshipsForTermFrom = new HashSet<Relationship>(
0);
 
public Term(Object object) {
this.object = object;
}
/**
* No-op constructor
*/
public Term()
{
}
 
public Term(Object object, String name,
Set<Relationship> relationshipsForTermTo,
Set<Relationship> relationshipsForTermFrom) {
this.object = object;
this.name = name;
this.relationshipsForTermTo = relationshipsForTermTo;
this.relationshipsForTermFrom = relationshipsForTermFrom;
}
/**
* @param object
*/
public Term(ObjectEntity object)
{
this.object = object;
}
 
@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object"))
@Id
@GeneratedValue(generator = "generator")
@Column(name = "object_id", unique = true, nullable = false)
public int getObjectId() {
return this.objectId;
}
/**
* @param object
* @param name
* @param relationshipsForTermTo
* @param relationshipsForTermFrom
*/
public Term(ObjectEntity object, String name,
Set<Relationship> relationshipsForTermTo,
Set<Relationship> relationshipsForTermFrom)
{
this.object = object;
this.name = name;
this.relationshipsForTermTo = relationshipsForTermTo;
this.relationshipsForTermFrom = relationshipsForTermFrom;
}
 
public void setObjectId(int objectId) {
this.objectId = objectId;
}
/**
* @return
*/
@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object"))
@Id
@GeneratedValue(generator = "generator")
@Column(name = "object_id", unique = true, nullable = false)
public int getObjectId()
{
return this.objectId;
}
 
@OneToOne(fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
public Object getObject() {
return this.object;
}
/**
* @param objectId
*/
public void setObjectId(int objectId)
{
this.objectId = objectId;
}
 
public void setObject(Object object) {
this.object = object;
}
/**
* @return ObjectEntity domain object
*/
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
public ObjectEntity getObject()
{
return this.object;
}
 
@Column(name = "name", unique = true)
public String getName() {
return this.name;
}
/**
* @param object
*/
public void setObject(ObjectEntity object)
{
this.object = object;
}
 
public void setName(String name) {
this.name = name;
}
/**
* @return
*/
@Column(name = "name", unique = true)
public String getName()
{
return this.name;
}
 
@OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermTo")
public Set<Relationship> getRelationshipsForTermTo() {
return this.relationshipsForTermTo;
}
/**
* @param name
*/
public void setName(String name)
{
this.name = name;
}
 
public void setRelationshipsForTermTo(
Set<Relationship> relationshipsForTermTo) {
this.relationshipsForTermTo = relationshipsForTermTo;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermTo")
public Set<Relationship> getRelationshipsForTermTo()
{
return this.relationshipsForTermTo;
}
 
@OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermFrom")
public Set<Relationship> getRelationshipsForTermFrom() {
return this.relationshipsForTermFrom;
}
/**
* @param relationshipsForTermTo
*/
public void setRelationshipsForTermTo(Set<Relationship> relationshipsForTermTo)
{
this.relationshipsForTermTo = relationshipsForTermTo;
}
 
public void setRelationshipsForTermFrom(
Set<Relationship> relationshipsForTermFrom) {
this.relationshipsForTermFrom = relationshipsForTermFrom;
}
/**
* @return
*/
@OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermFrom")
public Set<Relationship> getRelationshipsForTermFrom()
{
return this.relationshipsForTermFrom;
}
 
/**
* @param relationshipsForTermFrom
*/
public void setRelationshipsForTermFrom(
Set<Relationship> relationshipsForTermFrom)
{
this.relationshipsForTermFrom = relationshipsForTermFrom;
}
 
}