/** 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; }
/** Get the declaring table. This method is provided as part of * the implementation of the ReferenceKey interface but should only * be used when a ReferenceKey object is used or by the runtime. * @return the table that owns this reference key element, or * <code>null</code> if the element is not attached to any table */ public TableElement getDeclaringTable () { ArrayList locals = getReferencingKey(); if ((locals != null) && (locals.size() > 0)) { String absoluteName = NameUtil.getAbsoluteMemberName( getDeclaringClass().getDatabaseRoot(), locals.get(0).toString()); return TableElement.forName(NameUtil.getTableName(absoluteName)); } return null; }
/** Get the declaring table. This method is provided as part of * the implementation of the ReferenceKey interface but should only * be used when a ReferenceKey object is used or by the runtime. * @return the table that owns this reference key element, or * <code>null</code> if the element is not attached to any table */ public TableElement getDeclaringTable () { ArrayList locals = getReferencingKey(); if ((locals != null) && (locals.size() > 0)) { String absoluteName = NameUtil.getAbsoluteMemberName( getDeclaringClass().getDatabaseRoot(), locals.get(0).toString()); return TableElement.forName(NameUtil.getTableName(absoluteName)); } return null; }
ArrayList refKey = getReferencingKey(); ArrayList key = getTable().getKey(); int i, count = ((pairNames != null) ? pairNames.size() : 0);
ArrayList refKey = getReferencingKey(); ArrayList key = getTable().getKey(); int i, count = ((pairNames != null) ? pairNames.size() : 0);
/** Adds a column to the list of key columns in this referencing key. * This method is only called privately from addColumnPairs and assumes * that the column is not <code>null</code>. * @param column column element to be added * @exception ModelException if impossible */ private void addKeyColumn (ColumnElement column) throws ModelException { ArrayList referencingKey = getReferencingKey(); String columnName = NameUtil.getRelativeMemberName( column.getName().getFullName()); try { fireVetoableChange(PROP_KEY_COLUMNS, null, null); referencingKey.add(columnName); firePropertyChange(PROP_KEY_COLUMNS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }
/** Adds a column to the list of key columns in this referencing key. * This method is only called privately from addColumnPairs and assumes * that the column is not <code>null</code>. * @param column column element to be added * @exception ModelException if impossible */ private void addKeyColumn (ColumnElement column) throws ModelException { ArrayList referencingKey = getReferencingKey(); String columnName = NameUtil.getRelativeMemberName( column.getName().getFullName()); try { fireVetoableChange(PROP_KEY_COLUMNS, null, null); referencingKey.add(columnName); firePropertyChange(PROP_KEY_COLUMNS, null, null); } catch (PropertyVetoException e) { throw new ModelVetoException(e); } }