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();
}
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;
}
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;
}
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;
}
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;
}
Aggregations