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,10 → 27,17 |
*/ |
@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; |
|
@Transient |
private int objectId; |
private Object object; |
|
private ObjectEntity object; |
private String name; |
private Set<Relationship> relationshipsForTermTo = new HashSet<Relationship>( |
0); |
32,16 → 44,31 |
private Set<Relationship> relationshipsForTermFrom = new HashSet<Relationship>( |
0); |
|
public Term() { |
/** |
* No-op constructor |
*/ |
public Term() |
{ |
} |
|
public Term(Object object) { |
/** |
* @param object |
*/ |
public Term(ObjectEntity object) |
{ |
this.object = object; |
} |
|
public Term(Object object, String name, |
/** |
* @param object |
* @param name |
* @param relationshipsForTermTo |
* @param relationshipsForTermFrom |
*/ |
public Term(ObjectEntity object, String name, |
Set<Relationship> relationshipsForTermTo, |
Set<Relationship> relationshipsForTermFrom) { |
Set<Relationship> relationshipsForTermFrom) |
{ |
this.object = object; |
this.name = name; |
this.relationshipsForTermTo = relationshipsForTermTo; |
48,54 → 75,90 |
this.relationshipsForTermFrom = relationshipsForTermFrom; |
} |
|
/** |
* @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() { |
public int getObjectId() |
{ |
return this.objectId; |
} |
|
public void setObjectId(int objectId) { |
/** |
* @param objectId |
*/ |
public void setObjectId(int objectId) |
{ |
this.objectId = objectId; |
} |
|
@OneToOne(fetch = FetchType.LAZY) |
/** |
* @return ObjectEntity domain object |
*/ |
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) |
@PrimaryKeyJoinColumn |
public Object getObject() { |
public ObjectEntity getObject() |
{ |
return this.object; |
} |
|
public void setObject(Object object) { |
/** |
* @param object |
*/ |
public void setObject(ObjectEntity object) |
{ |
this.object = object; |
} |
|
/** |
* @return |
*/ |
@Column(name = "name", unique = true) |
public String getName() { |
public String getName() |
{ |
return this.name; |
} |
|
public void setName(String name) { |
/** |
* @param name |
*/ |
public void setName(String name) |
{ |
this.name = name; |
} |
|
@OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermTo") |
public Set<Relationship> getRelationshipsForTermTo() { |
public Set<Relationship> getRelationshipsForTermTo() |
{ |
return this.relationshipsForTermTo; |
} |
|
public void setRelationshipsForTermTo( |
Set<Relationship> relationshipsForTermTo) { |
/** |
* @param relationshipsForTermTo |
*/ |
public void setRelationshipsForTermTo(Set<Relationship> relationshipsForTermTo) |
{ |
this.relationshipsForTermTo = relationshipsForTermTo; |
} |
|
/** |
* @return |
*/ |
@OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermFrom") |
public Set<Relationship> getRelationshipsForTermFrom() { |
public Set<Relationship> getRelationshipsForTermFrom() |
{ |
return this.relationshipsForTermFrom; |
} |
|
/** |
* @param relationshipsForTermFrom |
*/ |
public void setRelationshipsForTermFrom( |
Set<Relationship> relationshipsForTermFrom) { |
Set<Relationship> relationshipsForTermFrom) |
{ |
this.relationshipsForTermFrom = relationshipsForTermFrom; |
} |
|