tables.add(getTableName(cld)); tables.addAll(getIndirectionTableNames(cld));
tables.add(getTableName(cld)); tables.addAll(getIndirectionTableNames(cld));
StringBuffer sb = new StringBuffer("CREATE TABLE " + DatabaseUtil.getTableName(cd) + " ("); boolean needsComma = false; for (AttributeDescriptor ad: cd.getAllAttributeDescriptors()) {
StringBuffer sb = new StringBuffer("CREATE TABLE " + DatabaseUtil.getTableName(cd) + " ("); boolean needsComma = false; for (AttributeDescriptor ad: cd.getAllAttributeDescriptors()) {
public void testGetTableNameTwo() throws Exception { ClassDescriptor cld = new ClassDescriptor("package.name.Array", null, false, new HashSet(), new HashSet(), new HashSet()); assertEquals("intermine_Array", DatabaseUtil.getTableName(cld)); }
public void testGetTableNameOne() throws Exception { ClassDescriptor cld = new ClassDescriptor("package.name.Class1", null, false, new HashSet(), new HashSet(), new HashSet()); assertEquals("Class1", DatabaseUtil.getTableName(cld)); }
+ DatabaseUtil.getTableName(tableMaster) + " AS a1_ WHERE a1_.id = " + id.toString() + " AND a1_.tableclass = '" + clazz.getName() + "' LIMIT 2"; } else { return "SELECT a1_.OBJECT AS a1_ FROM " + DatabaseUtil.getTableName(tableMaster) + " AS a1_ WHERE a1_.id = " + id.toString() + " LIMIT 2";
+ DatabaseUtil.getTableName(tableMaster) + " AS a1_ WHERE a1_.id = " + id.toString() + " AND a1_.tableclass = '" + clazz.getName() + "' LIMIT 2"; } else { return "SELECT a1_.OBJECT AS a1_ FROM " + DatabaseUtil.getTableName(tableMaster) + " AS a1_ WHERE a1_.id = " + id.toString() + " LIMIT 2";
/** * Returns the table name used by the ID fetch query. * * @param clazz the Class of the object * @param schema the DatabaseSchema * @return a table name * @throws ObjectStoreException if the given class is not in the model */ public static String tableNameForId(Class<?> clazz, DatabaseSchema schema) throws ObjectStoreException { ClassDescriptor tableMaster; if (schema.isMissingNotXml()) { tableMaster = schema.getModel() .getClassDescriptorByName(InterMineObject.class.getName()); } else { ClassDescriptor cld = schema.getModel().getClassDescriptorByName(clazz.getName()); if (cld == null) { throw new ObjectStoreException(clazz.toString() + " is not in the model"); } tableMaster = schema.getTableMaster(cld); } return DatabaseUtil.getTableName(tableMaster); }
/** * Returns the table name used by the ID fetch query. * * @param clazz the Class of the object * @param schema the DatabaseSchema * @return a table name * @throws ObjectStoreException if the given class is not in the model */ public static String tableNameForId(Class<?> clazz, DatabaseSchema schema) throws ObjectStoreException { ClassDescriptor tableMaster; if (schema.isMissingNotXml()) { tableMaster = schema.getModel() .getClassDescriptorByName(InterMineObject.class.getName()); } else { ClassDescriptor cld = schema.getModel().getClassDescriptorByName(clazz.getName()); if (cld == null) { throw new ObjectStoreException(clazz.toString() + " is not in the model"); } tableMaster = schema.getTableMaster(cld); } return DatabaseUtil.getTableName(tableMaster); }
String tableName = DatabaseUtil.getTableName(cld).toLowerCase(); if (!schema.getMissingTables().contains(tableName)) {
String tableName = DatabaseUtil.getTableName(cld).toLowerCase(); if (!schema.getMissingTables().contains(tableName)) {
className = DatabaseUtil.getTableName(cld); if (!schema.getMissingTables().contains(className.toLowerCase())) {
buffer.append(DatabaseUtil.getTableName(referencedClass) + " AS " + indirectTableAlias); buffer.append(" WHERE " + reverseRefAlias + " = " + arg1Alias);
buffer.append(DatabaseUtil.getTableName(referencedClass) + " AS " + indirectTableAlias); buffer.append(" WHERE " + reverseRefAlias + " = " + arg1Alias);
throw new ObjectStoreException("Cannot delete by query from " + qc.getType()); String tableName = DatabaseUtil.getTableName(getSchema().getModel() .getClassDescriptorByName(qc.getType().getName())); batch.flush(con, Collections.singleton(tableName));
className = DatabaseUtil.getTableName(cld); if (!schema.getMissingTables().contains(className.toLowerCase())) {
throw new ObjectStoreException("Cannot delete by query from " + qc.getType()); String tableName = DatabaseUtil.getTableName(getSchema().getModel() .getClassDescriptorByName(qc.getType().getName())); batch.flush(con, Collections.singleton(tableName));
String tableName = DatabaseUtil.getTableName(tableMaster); if (!schema.getMissingTables().contains(tableName.toLowerCase())) { batch.deleteRow(c, tableName, "id", o.getId());
String tableName = DatabaseUtil.getTableName(tableMaster); if (!schema.getMissingTables().contains(tableName.toLowerCase())) { batch.deleteRow(c, tableName, "id", o.getId());