/** * <p>INTERNAL: * * Legacy projects have 'findAll' and 'findByPrimaryKey' queries, whereas we now * expect these to have the descriptor alias appended (preceded with underscore), * + 'Type'. For example, if we have an Employee descriptor, the find queries * would be: 'findAll_employeeType' and 'findByPrimaryKey_employeeType'. * */ @SuppressWarnings("rawtypes") protected static void updateFindQueryNames(Project orProject) { for (ClassDescriptor orDesc : orProject.getDescriptors().values()) { Vector queries = orDesc.getQueryManager().getAllQueries(); for (int i=0; i<queries.size(); i++) { DatabaseQuery query = (DatabaseQuery) queries.get(i); String qName = query.getName(); String END_PART = UNDERSCORE_STR + query.getDescriptor().getAlias() + TYPE_STR; if ((PK_QUERYNAME.equals(qName) || ALL_QUERYNAME.equals(qName)) && !qName.endsWith(END_PART)) { orDesc.getQueryManager().addQuery(qName + END_PART, query); } } } }
/** * <p>INTERNAL: * * Legacy projects have 'findAll' and 'findByPrimaryKey' queries, whereas we now * expect these to have the descriptor alias appended (preceded with underscore), * + 'Type'. For example, if we have an Employee descriptor, the find queries * would be: 'findAll_employeeType' and 'findByPrimaryKey_employeeType'. * */ @SuppressWarnings("rawtypes") protected static void updateFindQueryNames(Project orProject) { for (ClassDescriptor orDesc : orProject.getDescriptors().values()) { Vector queries = orDesc.getQueryManager().getAllQueries(); for (int i=0; i<queries.size(); i++) { DatabaseQuery query = (DatabaseQuery) queries.get(i); String qName = query.getName(); String END_PART = UNDERSCORE_STR + query.getDescriptor().getAlias() + TYPE_STR; if ((PK_QUERYNAME.equals(qName) || ALL_QUERYNAME.equals(qName)) && !qName.endsWith(END_PART)) { orDesc.getQueryManager().addQuery(qName + END_PART, query); } } } }
getReadAllQuery().setDescriptor(descriptor); for (Iterator it = getAllQueries().iterator(); it.hasNext();) { ((DatabaseQuery)it.next()).setDescriptor(descriptor);
getReadAllQuery().setDescriptor(descriptor); for (Iterator it = getAllQueries().iterator(); it.hasNext();) { ((DatabaseQuery)it.next()).setDescriptor(descriptor);
getReadAllQuery().setDescriptor(descriptor); for (Iterator it = getAllQueries().iterator(); it.hasNext();) { ((DatabaseQuery)it.next()).setDescriptor(descriptor);
if (descriptor.getQueryManager().getAllQueries().size() > 0) { method.addLine("// Named Queries."); Enumeration namedQueries = descriptor.getQueryManager().getAllQueries().elements(); int iteration = 0; while (namedQueries.hasMoreElements()) {
if (descriptor.getQueryManager().getAllQueries().size() > 0) { method.addLine("// Named Queries."); Enumeration namedQueries = descriptor.getQueryManager().getAllQueries().elements(); int iteration = 0; while (namedQueries.hasMoreElements()) {
if (descriptor.getQueryManager().getAllQueries().size() > 0) { method.addLine("// Named Queries."); Enumeration namedQueries = descriptor.getQueryManager().getAllQueries().elements(); int iteration = 0; while (namedQueries.hasMoreElements()) {