package ch.ffhs.webE.domain;
// Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
/**
* Term generated by hbm2java
*/
@
Entity
@Table
(name =
"term", catalog =
"webengineering", uniqueConstraints = @UniqueConstraint
(columnNames =
"name"))
public class Term
implements java.
io.
Serializable {
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);
public Term
() {
}
public Term
(Object object
) {
this.
object = object
;
}
public Term
(Object object,
String name,
Set<Relationship
> relationshipsForTermTo,
Set<Relationship
> relationshipsForTermFrom
) {
this.
object = object
;
this.
name = name
;
this.
relationshipsForTermTo = relationshipsForTermTo
;
this.
relationshipsForTermFrom = relationshipsForTermFrom
;
}
@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;
}
public void setObjectId
(int objectId
) {
this.
objectId = objectId
;
}
@OneToOne
(fetch = FetchType.
LAZY)
@PrimaryKeyJoinColumn
public Object getObject
() {
return this.
object;
}
public void setObject
(Object object
) {
this.
object = object
;
}
@Column
(name =
"name", unique =
true)
public String getName
() {
return this.
name;
}
public void setName
(String name
) {
this.
name = name
;
}
@OneToMany
(fetch = FetchType.
LAZY, mappedBy =
"termByTermTo")
public Set<Relationship
> getRelationshipsForTermTo
() {
return this.
relationshipsForTermTo;
}
public void setRelationshipsForTermTo
(
Set<Relationship
> relationshipsForTermTo
) {
this.
relationshipsForTermTo = relationshipsForTermTo
;
}
@OneToMany
(fetch = FetchType.
LAZY, mappedBy =
"termByTermFrom")
public Set<Relationship
> getRelationshipsForTermFrom
() {
return this.
relationshipsForTermFrom;
}
public void setRelationshipsForTermFrom
(
Set<Relationship
> relationshipsForTermFrom
) {
this.
relationshipsForTermFrom = relationshipsForTermFrom
;
}
}