1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest03; 26 27 import java.util.Collection ; 28 29 import javax.persistence.Entity; 30 import javax.persistence.Id; 31 import javax.persistence.OneToMany; 32 import javax.persistence.OrderBy; 33 34 40 @Entity 41 public class ClassRoom { 42 43 46 private Long id; 47 50 private int capacity; 51 52 55 private Collection <Class > classes; 56 57 61 @OneToMany(mappedBy="classRoom") 62 @OrderBy("className ASC") 63 public Collection <Class > getClasses() { 64 return classes; 65 } 66 67 71 public void setClasses(final Collection <Class > classes) { 72 this.classes = classes; 73 } 74 75 79 public int getCapacity() { 80 return capacity; 81 } 82 83 87 public void setCapacity(final int capacity) { 88 this.capacity = capacity; 89 } 90 91 95 @Id 96 public Long getId() { 97 return id; 98 } 99 100 104 public void setId(final Long id) { 105 this.id = id; 106 } 107 108 109 } 110 | Popular Tags |