/** * Convenience method for whether a PK is required for the join table. Makes use of the extension * "primary-key" (within <join>) to allow turning off PK generation. * * @return Whether a PK is required */ protected boolean requiresPrimaryKey() { boolean pkRequired = true; if (mmd.getJoinMetaData() != null && mmd.getJoinMetaData().hasExtension("primary-key") && mmd.getJoinMetaData().getValueForExtension("primary-key").equalsIgnoreCase("false")) { pkRequired = false; } return pkRequired; }
/** * Accessor for the primary key for this table. Overrides the method in TableImpl to add on any * specification of PK name in the <join> metadata. * * @return The primary key. */ public PrimaryKey getPrimaryKey() { PrimaryKey pk = super.getPrimaryKey(); if (mmd.getJoinMetaData() != null) { PrimaryKeyMetaData pkmd = mmd.getJoinMetaData().getPrimaryKeyMetaData(); if (pkmd != null && pkmd.getName() != null) { pk.setName(pkmd.getName()); } } return pk; }