public String getName() { return getInternal().getName(); }
/** * Accessor for the primary key for this table. Overrides the method in TableImpl * to add on any specification of PK name in the metadata. * @return The primary key. */ public PrimaryKey getPrimaryKey() { PrimaryKey pk = super.getPrimaryKey(); PrimaryKeyMetaData pkmd = cmd.getPrimaryKeyMetaData(); if (pkmd != null && pkmd.getName() != null) { pk.setName(pkmd.getName()); } return pk; }
public String getXMLForMetaData(PrimaryKeyMetaData pkmd, String prefix, String indent) { StringBuilder str = new StringBuilder(); str.append(prefix).append("<primary-key" + (pkmd.getName() != null ? (" name=\"" + pkmd.getName() + "\"") : "") + (pkmd.getColumnName() != null ? (" column=\"" + pkmd.getColumnName() + "\"") : "") + ">\n"); // Add columns ColumnMetaData[] columns = pkmd.getColumnMetaData(); if (columns != null) { for (ColumnMetaData colmd : columns) { str.append(getXMLForMetaData(colmd, prefix + indent,indent)); } } // Add extensions processExtensions(pkmd.getExtensions(), str, prefix, indent); str.append(prefix).append("</primary-key>\n"); return str.toString(); }
/** * 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; }
/** * Accessor for the primary key for this table. Overrides the method in TableImpl * to add on any specification of PK name in the metadata. * @return The primary key. */ public PrimaryKey getPrimaryKey() { PrimaryKey pk = super.getPrimaryKey(); if (joinMetaData == null) { // TODO Localise this message throw new NucleusUserException("A relationship to a secondary table requires a <join> specification. " + "The secondary table is " + this.getDatastoreIdentifierFullyQualified() + " and the primary table is " + this.getPrimaryTable() + ". The fields mapped to this secondary table are: " + memberMappingsMap.keySet().toString()); } PrimaryKeyMetaData pkmd = joinMetaData.getPrimaryKeyMetaData(); if (pkmd != null && pkmd.getName() != null) { pk.setName(pkmd.getName()); } return pk; }
query.append(colName, 1); // TODO Support multicolumn PK field String pkName = (cmd.getPrimaryKeyMetaData() != null ? cmd.getPrimaryKeyMetaData().getName() : cmd.getName() + "_PK"); // TODO Do through NamingFactory DBObject indexObj = getIndexObjectForIndex(indices, pkName, query, true); if (indexObj != null) String pkName = (cmd.getPrimaryKeyMetaData() != null ? cmd.getPrimaryKeyMetaData().getName() : cmd.getName() + "_PK"); DBObject indexObj = getIndexObjectForIndex(indices, pkName, query, true); if (indexObj != null)
String pkName = (cmd.getPrimaryKeyMetaData() != null ? cmd.getPrimaryKeyMetaData().getName() : cmd.getName() + "_PK"); if (NucleusLogger.DATASTORE_SCHEMA.isDebugEnabled()) String pkName = (cmd.getPrimaryKeyMetaData() != null ? cmd.getPrimaryKeyMetaData().getName() : cmd.getName() + "_PK"); if (NucleusLogger.DATASTORE_SCHEMA.isDebugEnabled())