public Vector getParentInterfaceNames() { if (parentInterfaceNames.isEmpty() && !parentInterfaces.isEmpty()) { for (int i = 0; i < parentInterfaces.size(); i++) { parentInterfaceNames.addElement(((Class) parentInterfaces.elementAt(i)).getName()); } } return parentInterfaceNames; }
/** * PUBLIC: Return the foreign key field names associated with the mapping. These are only the * source fields that are writable. */ public void setForeignKeyFieldNames(Vector fieldNames) { Vector fields = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance( fieldNames.size()); for (Enumeration fieldNamesEnum = fieldNames.elements(); fieldNamesEnum.hasMoreElements(); ) { fields.addElement(new DatabaseField((String) fieldNamesEnum.nextElement())); } setForeignKeyFields(fields); if (!fields.isEmpty()) { setIsForeignKeyRelationship(true); } }
/** Append the string containing the SQL insert string for the given table. */ protected SQLCall buildCallWithoutReturning(AbstractSession session) { SQLCall call = new SQLCall(); call.returnNothing(); Writer writer = new CharArrayWriter(200); try { writer.write("INSERT "); if (getHintString() != null) { writer.write(getHintString()); writer.write(" "); } writer.write("INTO "); writer.write(getTable().getQualifiedNameDelimited(session.getPlatform())); writer.write(" ("); Vector fieldsForTable = new Vector(); for (Enumeration fieldsEnum = getModifyRow().keys(); fieldsEnum.hasMoreElements(); ) { DatabaseField field = (DatabaseField) fieldsEnum.nextElement(); if (field.getTable().equals(getTable()) || (!field.hasTableName())) { fieldsForTable.addElement(field); } } if (fieldsForTable.isEmpty()) { throw QueryException.objectToInsertIsEmpty(getTable()); } for (int i = 0; i < fieldsForTable.size(); i++) { writer.write( ((DatabaseField) fieldsForTable.elementAt(i)).getNameDelimited(session.getPlatform())); if ((i + 1) < fieldsForTable.size()) { writer.write(", "); } } writer.write(") VALUES ("); for (int i = 0; i < fieldsForTable.size(); i++) { DatabaseField field = (DatabaseField) fieldsForTable.elementAt(i); call.appendModify(writer, field); if ((i + 1) < fieldsForTable.size()) { writer.write(", "); } } writer.write(")"); call.setSQLString(writer.toString()); } catch (IOException exception) { throw ValidationException.fileError(exception); } return call; }
/** INTERNAL: Check if it is a child descriptor. */ public boolean isInterfaceChildDescriptor() { return ((!(parentInterfaces == null) && !parentInterfaces.isEmpty()) || (!(parentInterfaceNames == null) && !parentInterfaceNames.isEmpty())); }