Java 对象db add compiste index doen';行不通
我尝试在enttiy中添加堆肥索引,但没有效果 出现以下错误:Java 对象db add compiste index doen';行不通,java,jpa,objectdb,Java,Jpa,Objectdb,我尝试在enttiy中添加堆肥索引,但没有效果 出现以下错误: [error] application - message= Unexpected database state: BTree 49 is not found, cause= [ObjectDB 2.5.4] javax.persistence.PersistenceException Unexpected database state: BTree 49 is not found (error 147 模型类: @Entit
[error] application - message= Unexpected database state: BTree 49 is not found, cause= [ObjectDB 2.5.4] javax.persistence.PersistenceException
Unexpected database state: BTree 49 is not found (error 147
模型类:
@Entity
@Table(name = Customer.TABLE_NAME)
@javax.jdo.annotations.Index(members=
{"addresses.firstName,addresses.lastName,addresses.company"})
public class Customer extends ObjectDBBaseModel<Customer> {
List<Address> addresses;
}
@Entity
@Table(name = Address.TABLE_NAME)
public class Address<T extends ObjectDBBaseModel> extends ObjectDBBaseModel<T> {
public static final String TABLE_NAME = "address";
public static final Address NULL = new Address();
public static ODBFinder<Address> find = new ODBFinder<>(Address.class, NULL);
public Address() {
super((Class<T>) Address.class);
}
@Column(name = "address_type_enum")
@Enumerated(EnumType.STRING)
private AddressTypeEnum addressTypeEnum;
@Column(name = "gender_enum")
@Enumerated(EnumType.STRING)
private GenderEnum genderEnum;
private String title;
private String firstName;
private String lastName;
private String company;
private String street1;
}
@实体
@表(名称=客户。表\u名称)
@javax.jdo.annotations.Index(成员=
{“addresses.firstName,addresses.lastName,addresses.company”})
公共类客户扩展ObjectDBBaseModel{
列出地址;
}
@实体
@表(名称=地址。表名称)
公共类地址扩展了ObjectDBBaseModel{
公共静态最终字符串表\u NAME=“address”;
公共静态最终地址NULL=新地址();
publicstaticodbfinder find=newodbfinder(Address.class,NULL);
公共广播{
super((Class)Address.Class);
}
@列(name=“地址\类型\枚举”)
@枚举(EnumType.STRING)
私有地址类型枚举地址类型枚举;
@列(name=“gender_enum”)
@枚举(EnumType.STRING)
私有的根德伦;
私有字符串标题;
私有字符串名;
私有字符串lastName;
私人弦公司;
私家弦街1号;
}
索引定义无效,因为多路径索引仅限于一个实体类(以及其他可嵌入类),但不能扩展到多个实体类
在这种情况下,应使用两个单独的索引:
- 地址集合的简单索引
- 地址中三个字段的复合索引