Transaction tx = pm.currentTransaction();
try
{
tx.begin();
Query query = pm.newQuery( "SELECT FROM " + BuildResult.class.getName() +
" WHERE project.id == projectId PARAMETERS int projectId ORDER BY endTime DESC" );
query.declareImports( "import java.lang.Integer" );