Search in sources :

Example 66 with ColumnMetaData

use of org.datanucleus.metadata.ColumnMetaData in project datanucleus-api-jdo by datanucleus.

the class JDOMetaDataHelper method getXMLForMetaData.

public String getXMLForMetaData(ValueMetaData valmd, String prefix, String indent) {
    StringBuilder str = new StringBuilder();
    str.append(prefix).append("<value");
    if (valmd.getMappedBy() != null) {
        str.append(" mapped-by=\"" + valmd.getMappedBy() + "\"");
    }
    if (!StringUtils.isWhitespace(valmd.getTable())) {
        str.append(" table=\"" + valmd.getTable() + "\"");
    }
    if (!StringUtils.isWhitespace(valmd.getColumnName())) {
        str.append(" column=\"" + valmd.getColumnName() + "\"");
    }
    str.append(">\n");
    // Add columns
    ColumnMetaData[] columns = valmd.getColumnMetaData();
    if (columns != null) {
        for (ColumnMetaData colmd : columns) {
            str.append(getXMLForMetaData(colmd, prefix + indent, indent));
        }
    }
    // Add index metadata
    if (valmd.getIndexMetaData() != null) {
        str.append(getXMLForMetaData(valmd.getIndexMetaData(), prefix + indent, indent));
    }
    // Add unique metadata
    if (valmd.getUniqueMetaData() != null) {
        str.append(getXMLForMetaData(valmd.getUniqueMetaData(), prefix + indent, indent));
    }
    // Add embedded metadata
    if (valmd.getEmbeddedMetaData() != null) {
        str.append(getXMLForMetaData(valmd.getEmbeddedMetaData(), prefix + indent, indent));
    }
    // Add foreign-key metadata
    if (valmd.getForeignKeyMetaData() != null) {
        str.append(getXMLForMetaData(valmd.getForeignKeyMetaData(), prefix + indent, indent));
    }
    // Add extensions
    processExtensions(valmd.getExtensions(), str, prefix, indent);
    str.append(prefix).append("</value>\n");
    return str.toString();
}
Also used : ColumnMetaData(org.datanucleus.metadata.ColumnMetaData)

Example 67 with ColumnMetaData

use of org.datanucleus.metadata.ColumnMetaData in project datanucleus-api-jdo by datanucleus.

the class KeyMetadataImpl method newColumnMetadata.

/* (non-Javadoc)
     * @see javax.jdo.metadata.KeyMetadata#newColumnMetadata()
     */
public ColumnMetadata newColumnMetadata() {
    ColumnMetaData internalColmd = getInternal().newColumnMetaData();
    ColumnMetadataImpl colmd = new ColumnMetadataImpl(internalColmd);
    colmd.parent = this;
    return colmd;
}
Also used : ColumnMetaData(org.datanucleus.metadata.ColumnMetaData)

Example 68 with ColumnMetaData

use of org.datanucleus.metadata.ColumnMetaData in project datanucleus-api-jdo by datanucleus.

the class UniqueMetadataImpl method getColumns.

/* (non-Javadoc)
     * @see javax.jdo.metadata.UniqueMetadata#getColumns()
     */
public ColumnMetadata[] getColumns() {
    String[] internalColumnNames = getInternal().getColumnNames();
    if (internalColumnNames == null) {
        return null;
    }
    ColumnMetadataImpl[] colmds = new ColumnMetadataImpl[internalColumnNames.length];
    for (int i = 0; i < colmds.length; i++) {
        ColumnMetaData internalColmd = new ColumnMetaData();
        internalColmd.setName(internalColumnNames[i]);
        colmds[i] = new ColumnMetadataImpl(internalColmd);
        colmds[i].parent = this;
    }
    return colmds;
}
Also used : ColumnMetaData(org.datanucleus.metadata.ColumnMetaData)

Example 69 with ColumnMetaData

use of org.datanucleus.metadata.ColumnMetaData in project datanucleus-api-jdo by datanucleus.

the class UniqueMetadataImpl method newColumnMetadata.

/* (non-Javadoc)
     * @see javax.jdo.metadata.UniqueMetadata#newColumnMetadata()
     */
public ColumnMetadata newColumnMetadata() {
    ColumnMetaData internalColmd = new ColumnMetaData();
    internalColmd.setParent(getInternal());
    ColumnMetadataImpl colmd = new ColumnMetadataImpl(internalColmd);
    colmd.parent = this;
    return colmd;
}
Also used : ColumnMetaData(org.datanucleus.metadata.ColumnMetaData)

Example 70 with ColumnMetaData

use of org.datanucleus.metadata.ColumnMetaData in project datanucleus-api-jdo by datanucleus.

the class VersionMetadataImpl method newColumnMetadata.

/* (non-Javadoc)
     * @see javax.jdo.metadata.VersionMetadata#newColumnMetadata()
     */
public ColumnMetadata newColumnMetadata() {
    ColumnMetaData internalColmd = getInternal().newColumnMetaData();
    ColumnMetadataImpl colmd = new ColumnMetadataImpl(internalColmd);
    colmd.parent = this;
    return colmd;
}
Also used : ColumnMetaData(org.datanucleus.metadata.ColumnMetaData)

Aggregations

ColumnMetaData (org.datanucleus.metadata.ColumnMetaData)85 AbstractMemberMetaData (org.datanucleus.metadata.AbstractMemberMetaData)28 NucleusUserException (org.datanucleus.exceptions.NucleusUserException)16 ClassMetaData (org.datanucleus.metadata.ClassMetaData)14 AbstractClassMetaData (org.datanucleus.metadata.AbstractClassMetaData)13 ElementMetaData (org.datanucleus.metadata.ElementMetaData)13 DatastoreIdentifier (org.datanucleus.store.rdbms.identifier.DatastoreIdentifier)11 ClassLoaderResolver (org.datanucleus.ClassLoaderResolver)10 JoinMetaData (org.datanucleus.metadata.JoinMetaData)9 MetaDataManager (org.datanucleus.metadata.MetaDataManager)9 MappingManager (org.datanucleus.store.rdbms.mapping.MappingManager)8 Column (org.datanucleus.store.rdbms.table.Column)8 NucleusContext (org.datanucleus.NucleusContext)7 PersistenceNucleusContextImpl (org.datanucleus.PersistenceNucleusContextImpl)7 JPAMetaDataManager (org.datanucleus.api.jpa.metadata.JPAMetaDataManager)7 PrimaryKeyMetaData (org.datanucleus.metadata.PrimaryKeyMetaData)7 IdentifierFactory (org.datanucleus.store.rdbms.identifier.IdentifierFactory)7 JavaTypeMapping (org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping)7 DiscriminatorMetaData (org.datanucleus.metadata.DiscriminatorMetaData)6 PersistenceUnitMetaData (org.datanucleus.metadata.PersistenceUnitMetaData)6