Subversion Repositories WebE

Rev

Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

1
package ch.ffhs.webE.domain;

// Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
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;

/**
 * Relationship generated by hbm2java
 */

@Entity
@Table(name = "relationship", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = {
                "term_from", "term_to", "type" }))
public class Relationship implements java.io.Serializable {

        private int objectId;
        private Term termByTermTo;
        private Object object;
        private RelationshipType relationshipType;
        private Term termByTermFrom;

        public Relationship() {
        }

        public Relationship(Term termByTermTo, Object object,
                        RelationshipType relationshipType, Term termByTermFrom) {
                this.termByTermTo = termByTermTo;
                this.object = object;
                this.relationshipType = relationshipType;
                this.termByTermFrom = termByTermFrom;
        }

        @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;
        }

        @ManyToOne(fetch = FetchType.LAZY)
        @JoinColumn(name = "term_to", nullable = false)
        public Term getTermByTermTo() {
                return this.termByTermTo;
        }

        public void setTermByTermTo(Term termByTermTo) {
                this.termByTermTo = termByTermTo;
        }

        @OneToOne(fetch = FetchType.LAZY)
        @PrimaryKeyJoinColumn
        public Object getObject() {
                return this.object;
        }

        public void setObject(Object object) {
                this.object = object;
        }

        @ManyToOne(fetch = FetchType.LAZY)
        @JoinColumn(name = "type", nullable = false)
        public RelationshipType getRelationshipType() {
                return this.relationshipType;
        }

        public void setRelationshipType(RelationshipType relationshipType) {
                this.relationshipType = relationshipType;
        }

        @ManyToOne(fetch = FetchType.LAZY)
        @JoinColumn(name = "term_from", nullable = false)
        public Term getTermByTermFrom() {
                return this.termByTermFrom;
        }

        public void setTermByTermFrom(Term termByTermFrom) {
                this.termByTermFrom = termByTermFrom;
        }

}