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 тоже будет хорошо.
Thanks
вы используете спящий режим? – ant
@ant: Нет только запросов JDOQL –
@ant: Но запрос в спящем режиме также может быть удобным. Потому что тогда я могу попытаться преобразовать его в JAVA и, следовательно, в язык запросов ObjectDb –