0
나는 objectdb에 쿼리를 구현해야하고 거의 아이디어가 없습니다.objectdb의 쿼리
문제는
가Returns the collection of all laptops each of which has at least one
other laptop preinstalled with the same processor.
내 노트북 클래스는
public class Laptop {
String modelName; // key
int price; // in dollars
boolean hasHDScreen; // has a HD Screen ?
int hardDriveCapacity; // in GB
Processor processor; // the preinstalled processor
Memory memory; // the preinstalled memory
Company madeBy; // the inverse of company.makeLaptops
}
있는 쿼리를 작성하는 것입니다 내 프로세서 클래스는
public class Processor {
String modelName; // key
float clockSpeed; // in gigahertz (GHz)
Company madeBy; // the inverse of Company.makeProcessors
}
이 또한 내 함수 정의가
다음과 같습니다이다
public static Collection<Laptop> sameProcessor(Query q) {
/* Returns the collection of all laptops each of which has at least one
* other laptop preinstalled with the same processor.
*/
q.setClass(Laptop.class);
q.setFilter("this.processor == ");
}
어떻게하면됩니까? SQL은 괜찮을 것이다.
감사합니다.
최대 절전 모드를 사용 하시겠습니까? – ant
@ant : 단지 JDOQL 쿼리가 아닙니다. –
@ant : 그러나 최대 절전 모드의 쿼리는 또한 편리 할 수 있습니다. 왜냐하면 나는 JAVA와 ObjectDb 질의어로 변환하려고 시도 할 수 있기 때문이다. –