1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.geometricforms; 26 27 import javax.persistence.EntityListeners; 28 import javax.persistence.EnumType; 29 import javax.persistence.Enumerated; 30 import javax.persistence.GeneratedValue; 31 import javax.persistence.GenerationType; 32 import javax.persistence.Id; 33 import javax.persistence.MappedSuperclass; 34 import javax.persistence.NamedQuery; 35 import javax.persistence.TableGenerator; 36 37 import org.objectweb.easybeans.tests.common.listeners.FormsListener00; 38 39 45 @MappedSuperclass 46 @EntityListeners(FormsListener00.class) 47 @NamedQuery(name = "findAllByType", query = "SELECT f FROM Form f WHERE f.formType = :formType") 48 @TableGenerator(name = "ID_SEQ", allocationSize = 1) 49 public class Form { 50 51 54 private int id; 55 56 59 private float area; 60 61 64 private float perimeter; 65 66 69 private FormType formType; 70 71 75 @Enumerated(EnumType.STRING) 76 public FormType getFormType() { 77 return formType; 78 } 79 80 84 public void setFormType(final FormType formType) { 85 this.formType = formType; 86 } 87 88 89 93 public float getArea() { 94 return area; 95 } 96 97 101 public void setArea(final float area) { 102 this.area = area; 103 } 104 105 109 @Id 110 @GeneratedValue(strategy=GenerationType.TABLE, generator="ID_SEQ") 111 public int getId() { 112 return id; 113 } 114 115 119 public void setId(final int id) { 120 this.id = id; 121 } 122 123 127 public float getPerimeter() { 128 return perimeter; 129 } 130 131 135 public void setPerimeter(final float perimeter) { 136 this.perimeter = perimeter; 137 } 138 139 } 140 | Popular Tags |