문제

I have the below domain model class

@Entity @Access(AccessType.FIELD)
public class MyBean {

     @Id @GeneratedValue
     private Long id;

     ...

     @Transient
     public String getOther() {
          ...
     }
}

Running DataNucleus Enhancer gives the following error: Class MyBean has application-identity and no objectid-class specified yet has 0 primary key fields. Unable to use SingleFieldIdentity.

Why?

도움이 되었습니까?

해결책

It seems that the problem is the @Transient annotation on the method. Removing it solved the issue.

Still, in this case, taking into account the @Access and @Id annotation on a field, the @Transient annotation should be ignored. Or, preferably, the error message should be improved.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top