/** Returns the list of relative column pair names in this referencing key. * @return the names of the column pairs in this referencing key */ public ArrayList getColumnPairNames () { ArrayList locals = getReferencingKey(); ArrayList foreigns = getTable().getKey(); int i, count = ((locals != null) ? locals.size() : 0); ArrayList pairs = new ArrayList(); for (i = 0; i < count; i++) pairs.add(locals.get(i) + ";" + foreigns.get(i)); // NOI18N return pairs; }
/** Returns the list of relative column pair names in this referencing key. * @return the names of the column pairs in this referencing key */ public ArrayList getColumnPairNames () { ArrayList locals = getReferencingKey(); ArrayList foreigns = getTable().getKey(); int i, count = ((locals != null) ? locals.size() : 0); ArrayList pairs = new ArrayList(); for (i = 0; i < count; i++) pairs.add(locals.get(i) + ";" + foreigns.get(i)); // NOI18N return pairs; }
/** Set the mapping table for this referencing key to the supplied table. * @param table mapping table element to be used with this key. * @exception ModelException if impossible */ public void setTable (MappingTableElement table) throws ModelException { MappingTableElement old = getTable(); try { fireVetoableChange(PROP_TABLE, old, table); setTableInternal(table); firePropertyChange(PROP_TABLE, old, table); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Set the mapping table for this referencing key to the supplied table. * @param table mapping table element to be used with this key. * @exception ModelException if impossible */ public void setTable (MappingTableElement table) throws ModelException { MappingTableElement old = getTable(); try { fireVetoableChange(PROP_TABLE, old, table); setTableInternal(table); firePropertyChange(PROP_TABLE, old, table); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
ArrayList key = getTable().getKey(); int i, count = ((pairNames != null) ? pairNames.size() : 0);
ArrayList key = getTable().getKey(); int i, count = ((pairNames != null) ? pairNames.size() : 0);
/** Find a column pair by name. * @param name the name of the column pair for which to look * @return the column pair or <code>null</code> if not found */ public ColumnPairElement getColumnPair (DBIdentifier name) { ColumnPairElement[] myPairs = getColumnPairs(); int count = ((myPairs != null) ? myPairs.length : 0); String databaseRoot = getDeclaringClass().getDatabaseRoot(); if (count > 0) { String absoluteTableName = NameUtil.getAbsoluteTableName( databaseRoot, getTable().getName()); ColumnPairElement searchPair = (ColumnPairElement) TableElement.forName(absoluteTableName).getMember(name); int i; for (i = 0; i < count; i++) { if (myPairs[i].equals(searchPair)) return searchPair; } } return null; }
/** Find a column pair by name. * @param name the name of the column pair for which to look * @return the column pair or <code>null</code> if not found */ public ColumnPairElement getColumnPair (DBIdentifier name) { ColumnPairElement[] myPairs = getColumnPairs(); int count = ((myPairs != null) ? myPairs.length : 0); String databaseRoot = getDeclaringClass().getDatabaseRoot(); if (count > 0) { String absoluteTableName = NameUtil.getAbsoluteTableName( databaseRoot, getTable().getName()); ColumnPairElement searchPair = (ColumnPairElement) TableElement.forName(absoluteTableName).getMember(name); int i; for (i = 0; i < count; i++) { if (myPairs[i].equals(searchPair)) return searchPair; } } return null; }
MappingTableElementImpl table = (MappingTableElementImpl)getTable(); int i, count = ((pairs != null) ? pairs.length : 0);
MappingTableElementImpl table = (MappingTableElementImpl)getTable(); int i, count = ((pairs != null) ? pairs.length : 0);