Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA Hibernate Annotations

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

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" />
</joined-subclass>

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

Here�s the code

Interface

@Entity
@Table(name = "User")
@Inheritance(strategy=InheritanceType.JOINED)
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



@Entity
@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(
criteriaCallback);



Please, can someone help me?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic