java - Mappedsuperclass and namedqueries -
i have mappedsuperclass :
@mappedsuperclass @discriminatorcolumn(name = "user_type") @inheritance(strategy = inheritancetype.single_table) @namedqueries({ @namedquery(name = "selectallusers", query = "select u user u"), @namedquery(name = "deleteuserbyname", query = "delete user u u.username :name"), @namedquery(name = "getuserbyname", query = "select user u u.username :name") }) public abstract class user implements serializable {....
i "the abstract schema type 'user' unknown" error on namedquery. don't understand why ... name user right?
any suggestions welcome.
this expected jpa behaviour. mapped superclasses not queryable (see jpa 2.0 spec, section 2.11.2). if want create superclass queryable, alter annotation @mappedsuperclass
@entity
.
java jpa
No comments:
Post a Comment