1 22 package org.jboss.ejb3.test.entity; 23 24 import javax.persistence.Entity; 25 import javax.persistence.GeneratedValue; 26 import javax.persistence.GenerationType; 27 import javax.persistence.Id; 28 import javax.persistence.NamedQuery; 29 30 36 @Entity 37 @NamedQuery(name="airportByCode", query="from FieldAirport a where a.code=:code") 38 public class FieldAirport 39 { 40 41 @Id @GeneratedValue(strategy=GenerationType.AUTO) 42 Long id; 43 String code; 44 String city; 45 46 public FieldAirport() {} 47 48 public FieldAirport(String code, String city) 49 { 50 this.code = code; 51 this.city = city; 52 } 53 54 } 55 | Popular Tags |