• Post Reply Bookmark Topic Watch Topic
  • New Topic

JPA Hibernate Annotations  RSS feed

Romulo Panassolo
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I Use hibernate and I get use to map the class with xml files
I have mapped interface that use joined-subclass to map his class implementation and it works very well.

See below

<class name="User" table="User" dynamic-update="true" dynamic-insert="true" select-before-update="false" optimistic-lock="version">

// map others attributes

<joined-subclassname="UserImpl" table="USER_IMPL">
<key column="cd_basic" />

The problem is when I try to use Annotations.It doesn�t work

Here�s the code


@Table(name = "User")
public interface BasicAuthorizedUser extends Serializable {

// i mapped all the gets operations
eg: @Column(name = "ds_name")
public String getName();

// for the set operations i used @Transient

@Table(name = "User_Impl ")
@PrimaryKeyJoinColumn(name="cd_basic ")
public class BasicAuthorizedUserImpl implements BasicAuthorizedUser {

// i didn't map the attributes

The error message is: Cannot instantiate abstract class or interface: User
It happened in the findAll operation when
I created a criteriaCallback

return (List<T> this.getHibernateTemplate().execute(

Please, can someone help me?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!