0
나는 1-1 개의 관계가있는 두 개의 클래스가 있습니다. 클래스가 최종 클래스이므로 상속이 없습니다.mongodb + datanucleus의 참조에서 클래스 이름을 제거하는 방법
@PersistantCapable
@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY)
class A {
@PrimaryKey
@Column(name = "_id")
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT
long id;
}
class B { A a; }
전체 시스템이 올바르게 작동하지만 참조가 매우 비효율적으로 표시됩니다. 예 : {a : "full.class.name.A : 3"}. 클래스 이름을 제거하고 정수를 사용하여 ID를 저장하려면 속도 (특히 인덱스)와 디스크 공간 소비가 향상됩니다.
DatastoreIdentity를 사용할 수 없으며 PrimaryKey 필드도 사용할 수 있습니다. –