我尝试在 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
模型类:
@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;
}