Object Query

Engine Raw API

Raw API example by implentation

JPA

Direct execute:

javax.persistence.EntityManager entityManager= ....
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
List<Person> res = (List<Person>)JPASelectQuery.execute(query, entityManager);
...
JPA query generation:
javax.persistence.EntityManager entityManager= ....
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
javax.persistence.Query jpaQuery = JPASelectQuery.buildQuery(query, entityManager);
...
JPQL string and parameters generation:
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
JPQLQueryGenerator jpqlGenerator = JPASelectQuery.jpqlGenerator(query);
String jpql = jpqlGenerator.getQuery();
Map<String,Object> paramenters = jpqlGenerator.getParameters();
...
JDO

Direct execute:

javax.jdo.PersistenceManager peristenceManager= ....
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
List<Person> res = (List<Person>)JDOSelectQuery.execute(query, peristenceManager);
...
JDOQL string and parameters generation:
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
JDOQLQueryGenerator jdoqlGenerator = JDOSelectQuery.jdoqlGenerator(query);
String jpql = jdoqlGenerator.getQuery();
Map<String,Object> paramenters = jdoqlGenerator.getParameters();
...
OrientDB

Direct execute:

com.orientechnologies.orient.object.db.OObjectDatabaseTx db= ....
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
List<Person> res = (List<Person>)OrientDBSelectQuery.execute(query, db);
...
OrientDB Query string and parameters generation:
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
OrientDBQueryGenerator oriendbGenerator = OrientDBSelectQuery.oriendbGenerator(query);
String orientdbql = oriendbGenerator.getQuery();
Map<String,Object> paramenters = oriendbGenerator.getParameters();
...

Hibernate

Direct execute:

org.hibernate.Session session= ....
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
List<Person> res = (List<Person>)HibernateSelectQuery.execute(query, session);
...
Hibernate query generation:
org.hibernate.Session session= ....
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
org.hibernate.Query jpaQuery = HibernateSelectQuery.buildQuery(query, session);
...
HQL string and parameters generation:
SelectQuery<Person> query = new GenericSelectQuery<Person>(Person.class);
...
HQLQueryGenerator hqlGenerator = HibernateSelectQuery.hqlGenerator(query);
String hql = hqlGenerator.getQuery();
Map<String,Object> paramenters = hqlGenerator.getParameters();
...