Added named queries to Foo Model
This commit is contained in:
parent
ff4b5d26b0
commit
95e6cb16d7
|
@ -11,9 +11,14 @@ import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.ManyToOne;
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.NamedNativeQueries;
|
||||||
|
import javax.persistence.NamedNativeQuery;
|
||||||
|
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
|
|
||||||
|
@NamedNativeQueries({
|
||||||
|
@NamedNativeQuery(name = "callGetAllFoos", query = "CALL GetAllFoos()", resultClass = Foo.class),
|
||||||
|
@NamedNativeQuery(name = "callGetFoosByName", query = "CALL GetFoosByName(:fooName)", resultClass = Foo.class) })
|
||||||
@Entity
|
@Entity
|
||||||
@Audited
|
@Audited
|
||||||
// @Proxy(lazy = false)
|
// @Proxy(lazy = false)
|
||||||
|
@ -99,5 +104,4 @@ public class Foo implements Serializable {
|
||||||
builder.append("Foo [name=").append(name).append("]");
|
builder.append("Foo [name=").append(name).append("]");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue