小编Rob*_*Jan的帖子

性能OpenJPA查询(3000+记录)很慢

我正在使用带有buildin OpenJPA 1.2.3和Oracle数据库的Websphere Application Server 7.我有以下实体:

    @NamedNativeQuery(name=Contract.GIVE_ALL_CONTRACTS, 
        query="SELECT number, name \n" +
          "FROM contracts \n" +
          "WHERE startdate <= ?1 \n" +
          "AND enddate > ?1",
          resultSetMapping = Contract.GIVE_ALL_CONTRACTS_MAPPING)
    @SqlResultSetMapping(name = Contract.GIVE_ALL_CONTRACTS_MAPPING, 
        entities = { @EntityResult(entityClass = Contract.class, fields = {
          @FieldResult(name = "number", column = "number"),
          @FieldResult(name = "name", column = "name")
        })
    })
    @Entity
    public class Contract {
      public static final String GIVE_ALL_CONTRACTS = "Contract.giveAllContracts";
      public static final String GIVE_ALL_CONTRACTS_MAPPING = "Contract.giveAllContractsMapping";

      @Id
      private Integer number;
      private String …
Run Code Online (Sandbox Code Playgroud)

java websphere openjpa

6
推荐指数
1
解决办法
2327
查看次数

标签 统计

java ×1

openjpa ×1

websphere ×1