I am receiving the following message in my Entity object ?
Basic attribute type should not be IDao
Where it is being used like this :
@Entity
@Table
public final class MyEnity {
@Resource(name = "Dao")
private IDao dao;
I know the name is bad, but what is the problem with injecting my Dao(annotated with repository) into my Domain object that is annotated as a hibernate entity ? And IDao is an interface implemented by Dao class …
IDaoseems to be a processing element getting injected into an entity and you don’t intend to persist it. If so, you should mark it astransientso that the ORM will ignore it during CRUD operations on the entity.BTW, I don’t see your entity to be
@Configurable. How do you plan to getdaoinjected into it? The ORM is going to create a new object of typeMyEntityusing the default constrcutor and call the setters to set the values from the database. YourIDao daowill not get injected as such an instance is not a spring-managed bean. You have to markMyEntityas@Configurableto make it spring managed so that instances created usingnewoperator will get the resource injected.