1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest00; 26 27 import java.io.Serializable ; 28 import java.util.Date ; 29 30 import javax.persistence.DiscriminatorColumn; 31 import javax.persistence.DiscriminatorValue; 32 import javax.persistence.Entity; 33 import javax.persistence.GeneratedValue; 34 import javax.persistence.GenerationType; 35 import javax.persistence.Id; 36 import javax.persistence.Inheritance; 37 import javax.persistence.InheritanceType; 38 import javax.persistence.Lob; 39 import javax.persistence.Table; 40 import javax.persistence.TableGenerator; 41 import javax.persistence.Temporal; 42 import javax.persistence.TemporalType; 43 44 50 @Entity 51 @Table(name = "PERSON") 52 @DiscriminatorColumn(name = "PersonType") 53 @DiscriminatorValue("Person") 54 @Inheritance(strategy = InheritanceType.SINGLE_TABLE) 55 @TableGenerator(name = "PERSON_SEQ", allocationSize = 2) 56 public class Person implements Serializable { 57 58 61 private static final long serialVersionUID = -2588575691131751927L; 62 63 66 private Long id; 67 68 71 private String familyName; 72 73 76 private String firstName; 77 78 81 private Date startDate; 82 83 86 private Date endDate; 87 88 91 private byte[] picture; 92 93 97 @Temporal(TemporalType.DATE) 98 public Date getEndDate() { 99 return endDate; 100 } 101 102 106 public void setEndDate(final Date endDate) { 107 this.endDate = endDate; 108 } 109 110 114 public String getFamilyName() { 115 return familyName; 116 } 117 118 122 public void setFamilyName(final String familyName) { 123 this.familyName = familyName; 124 } 125 126 130 public String getFirstName() { 131 return firstName; 132 } 133 134 138 public void setFirstName(final String firstName) { 139 this.firstName = firstName; 140 } 141 142 146 147 @Id 148 @GeneratedValue(strategy = GenerationType.TABLE, generator = "PERSON_SEQ") 149 public Long getId() { 150 return id; 151 } 152 153 157 @Temporal(TemporalType.DATE) 158 public Date getStartDate() { 159 return startDate; 160 } 161 162 166 public void setStartDate(final Date startDate) { 167 this.startDate = startDate; 168 } 169 170 174 @Lob 175 public byte[] getPicture() { 176 return picture; 177 } 178 179 183 public void setPicture(final byte[] picture) { 184 this.picture = picture; 185 } 186 187 191 public void setId(final Long id) { 192 this.id = id; 193 } 194 195 } 196 | Popular Tags |