~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-annotations-3.4.0.GA/test/org/hibernate/test/annotations/idmanytoone/Card.java

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//$Id: Card.java 14736 2008-06-04 14:23:42Z hardy.ferentschik $
2
 
package org.hibernate.test.annotations.idmanytoone;
3
 
 
4
 
import java.io.Serializable;
5
 
import java.util.Set;
6
 
import javax.persistence.Embeddable;
7
 
import javax.persistence.Entity;
8
 
import javax.persistence.Id;
9
 
import javax.persistence.ManyToOne;
10
 
import javax.persistence.CascadeType;
11
 
import javax.persistence.FetchType;
12
 
import javax.persistence.OneToMany;
13
 
 
14
 
/**
15
 
 * @author Emmanuel Bernard
16
 
 */
17
 
@Entity
18
 
public class Card {
19
 
 
20
 
        @Id
21
 
        private CardPrimaryKey primaryKey = new CardPrimaryKey();
22
 
 
23
 
        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "primaryKey.card")
24
 
        private Set<CardField> fields;
25
 
 
26
 
        @ManyToOne
27
 
        private CardField mainCardField;
28
 
 
29
 
        @Embeddable
30
 
        public static class CardPrimaryKey implements Serializable {
31
 
 
32
 
                public CardPrimaryKey() {}
33
 
 
34
 
                @ManyToOne(optional = false)
35
 
                private Project project;
36
 
 
37
 
                public Project getProject() {
38
 
                        return project;
39
 
                }
40
 
 
41
 
                public void setProject(Project project) {
42
 
                        this.project = project;
43
 
                }
44
 
 
45
 
        }
46
 
 
47
 
        public Set<CardField> getFields() {
48
 
                return fields;
49
 
        }
50
 
 
51
 
        public void setFields(Set<CardField> fields) {
52
 
                this.fields = fields;
53
 
        }
54
 
 
55
 
        public CardPrimaryKey getPrimaryKey() {
56
 
                return primaryKey;
57
 
        }
58
 
 
59
 
        public void setPrimaryKey(CardPrimaryKey primaryKey) {
60
 
                this.primaryKey = primaryKey;
61
 
        }
62
 
 
63
 
        public CardField getMainCardField() {
64
 
                return mainCardField;
65
 
        }
66
 
 
67
 
        public void setMainCardField(CardField mainCardField) {
68
 
                this.mainCardField = mainCardField;
69
 
        }
70
 
}