2017-10-15 1 views
0

두 객체를 생성했습니다. 하나는 다른 하나를 확장합니다. 그것은 ObjectBox 문서에 작성된 부모 객체는 ID를 가지고,하지만 난의 오류와 함께 프로젝트를 빌드 할 수 없습니다ObjectBox가 상속을 사용하여 프로젝트를 빌드 할 수 없습니다.

Error:[ObjectBox] Code generation failed: No ID property found for "Entity FastCacheData" (use @Id on a property of type long) 

CacheData :

@Entity 
public class CacheData { 
    @Id 
    private long id; 
    @Index 
    private String key; 
    @Index 
    private Date expirationDate; 
    private Date lastUpdated; 

    public CacheData(String key, Date expirationDate) { 
     this.lastUpdated = new Date(); 
     this.key = key; 
     this.expirationDate = expirationDate; 
    } 
} 

FastCacheData :

@Entity 
public class FastCacheData extends CacheData { 
    private String fullName; 
    private String thumbnailUrl; 
    private boolean isSpam; 

    @Convert(converter = DataSource.DataSourceConverter.class, dbType = Integer.class) 
    private DataSource photoDataSource; 

    @Convert(converter = DataSource.DataSourceConverter.class, dbType = Integer.class) 
    private DataSource nameDataSource; 

    public FastCacheData(String key, Date expirationDate, String fullName, DataSource nameDataSource, String thumbnailUrl, DataSource photoDataSource, boolean isSpam) { 
     super(key, expirationDate); 
     this.fullName = fullName; 
     this.nameDataSource = nameDataSource; 
     this.thumbnailUrl = thumbnailUrl; 
     this.photoDataSource = photoDataSource; 
     this.isSpam = isSpam; 
    } 
} 

답변

1

엔티티의 다형성이 su가 아닙니다. 이 시점에 게시되었지만 feature request이 있습니다.

관련 문제