1

我对 Apache ISIS 很陌生,我想通过带有遗留数据库(MYSQL)的 dataNucleus 获取一个列表,有 300,000 条数据,但是当我尝试使用 repositoryService.allInstances() 方法来获取一个列表,返回列表的大小为 2。我有其他域对象,并且工作正常。这是代码和调试信息。

@PersistenceCapable(
    identityType = IdentityType.DATASTORE,
    schema = "public",
    table = "tinstruction_parameter_value"
)
@DatastoreIdentity(
    strategy = IdGeneratorStrategy.IDENTITY,
    column = "id")
@Queries({
    @Query(
            name = "find", language = "JDOQL",
            value = "SELECT "
                    + "FROM      domainapp.modules.simple.dom.impl.xfs.parameter.InstructionParameterValueTest "),
    @Query(
            name = "findByValueContains", language = "JDOQL",
            value = "SELECT "
                    + "FROM  domainapp.modules.simple.dom.impl.xfs.parameter.InstructionParameterValueTest "
                    + "WHERE value.indexOf(:value) >= 0 "),
    @Query(
            name = "findByValue", language = "JDOQL",
            value = "SELECT "
                    + "FROM      domainapp.modules.simple.dom.impl.xfs.parameter.InstructionParameterValueTest "
                    + "WHERE value == :value ")
})
@DomainObject(
    editing = Editing.DISABLED
)
@DomainObjectLayout(
    bookmarking = BookmarkPolicy.AS_ROOT
)
public class InstructionParameterValueTest implements      Comparable<InstructionParameterValueTest> {

@Column(allowsNull = "true",jdbcType = "CLOB")
@Property()
@MemberOrder(sequence = "10")
@Getter @Setter
private String value;

//region > compareTo, toString
@Override
public int compareTo(final InstructionParameterValueTest other) {
    return org.apache.isis.applib.util.ObjectContracts.compare(this, other,   "value");
}

@Override
public String toString() {
    return org.apache.isis.applib.util.ObjectContracts.toString(this, "value");
}
//endregion

}

public class InstructionParameterValueTestRepository {

  @Programmatic
  public java.util.List<InstructionParameterValueTest> listAll() {
    return repositoryService.allInstances(InstructionParameterValueTest.class);
  }
}

dataNucleus 调试日志

不知道为什么list的大小是2,不是所有的数据,调试sql可以执行并获取所有的数据。 dataNucleus sql execute 谁能告诉我我应该做什么,

4

0 回答 0