Java 如何优化hibernate查询,特别是在继承方面
对于查询的hibernate优化,在继承类型Java 如何优化hibernate查询,特别是在继承方面,java,hibernate,jpa,jboss,Java,Hibernate,Jpa,Jboss,对于查询的hibernate优化,在继承类型表\u Per_Class中,如何避免(两个类的并集)上的where子句,而是在每个子类上应用where子句 @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class Animal { int pkey; String name; } public class Dog extends Animal { long numSlippers
表\u Per_Class
中,如何避免(两个类的并集)上的where子句,而是在每个子类上应用where子句
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class Animal {
int pkey;
String name;
}
public class Dog extends Animal {
long numSlippersChewed; // int is not large enough...
}
public class Cat extends Animal {
short miceCaught; // ... but here int is far bigger than required :-)
}
在上面的代码中,如果我有子类
如大象等
我对名称的where子句进行了查询,然后
当前hibernate实现联合所有表,然后应用where子句,
这会导致sql内存空间问题
Hibernate可以分别在每个子类上应用where子句,然后创建一个联合吗
此问题上的任何指针hql优化查询在每个子类上应用where子句