public class MetadataTools extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MetadataTools.ColumnNameIterator
An iterator over column names.
|
Constructor and Description |
---|
MetadataTools() |
Modifier and Type | Method and Description |
---|---|
static void |
addColumn(Element any_mapping,
Column column)
Adds
column element with the following attributes (unless empty): name ,
length , scale , precision , sql-type , read
and write . |
static Element |
addColumn(Element parent,
String name,
Integer length,
Integer scale,
Integer precision,
String sqlType,
String customRead,
String customWrite)
Adds new
column element. |
static Element |
addColumn(Element parent,
String name,
Integer length,
Integer scale,
Integer precision,
String sqlType,
String customRead,
String customWrite,
boolean quoted) |
static void |
addColumns(Element any_mapping,
Iterator<Column> columns) |
static void |
addColumnsOrFormulas(Element element,
Iterator columnIterator)
Adds all
column or formula elements. |
static void |
addFormula(Element element,
Formula formula)
Adds
formula element. |
static Element |
addModifiedFlagProperty(Element parent,
String propertyName,
String suffix) |
static Element |
addNativelyGeneratedId(Element parent,
String name,
String type) |
static Element |
addOrModifyColumn(Element parent,
String name)
Column name shall be wrapped with '`' signs if quotation required.
|
static Element |
addProperty(Element parent,
String name,
String type,
boolean insertable,
boolean key) |
static Element |
addProperty(Element parent,
String name,
String type,
boolean insertable,
boolean updateable,
boolean key) |
static Element |
createEntity(Document document,
AuditTableData auditTableData,
String discriminatorValue) |
static Element |
createJoin(Element parent,
String tableName,
String schema,
String catalog) |
static Element |
createSubclassEntity(Document document,
String subclassType,
AuditTableData auditTableData,
String extendsEntityName,
String discriminatorValue) |
static MetadataTools.ColumnNameIterator |
getColumnNameIterator(Iterator<Column> columnIterator) |
static MetadataTools.ColumnNameIterator |
getColumnNameIterator(JoinColumn[] joinColumns) |
static String |
getModifiedFlagPropertyName(String propertyName,
String suffix) |
static void |
prefixNamesInPropertyElement(Element element,
String prefix,
MetadataTools.ColumnNameIterator columnNameIterator,
boolean changeToKey,
boolean insertable) |
public static Element addNativelyGeneratedId(Element parent, String name, String type)
public static Element addProperty(Element parent, String name, String type, boolean insertable, boolean updateable, boolean key)
public static Element addProperty(Element parent, String name, String type, boolean insertable, boolean key)
public static Element addModifiedFlagProperty(Element parent, String propertyName, String suffix)
public static String getModifiedFlagPropertyName(String propertyName, String suffix)
public static Element addOrModifyColumn(Element parent, String name)
public static Element addColumn(Element parent, String name, Integer length, Integer scale, Integer precision, String sqlType, String customRead, String customWrite)
column
element. Method assumes that the value of name
attribute is already
wrapped with '`' signs if quotation required. It shall be invoked when column name is taken directly from configuration
file and not from PersistentClass
descriptor.public static Element addColumn(Element parent, String name, Integer length, Integer scale, Integer precision, String sqlType, String customRead, String customWrite, boolean quoted)
public static Element createEntity(Document document, AuditTableData auditTableData, String discriminatorValue)
public static Element createSubclassEntity(Document document, String subclassType, AuditTableData auditTableData, String extendsEntityName, String discriminatorValue)
public static Element createJoin(Element parent, String tableName, String schema, String catalog)
public static void addColumn(Element any_mapping, Column column)
column
element with the following attributes (unless empty): name
,
length
, scale
, precision
, sql-type
, read
and write
.any_mapping
- Parent element.column
- Column descriptor.public static void prefixNamesInPropertyElement(Element element, String prefix, MetadataTools.ColumnNameIterator columnNameIterator, boolean changeToKey, boolean insertable)
public static void addFormula(Element element, Formula formula)
formula
element.element
- Parent element.formula
- Formula descriptor.public static void addColumnsOrFormulas(Element element, Iterator columnIterator)
column
or formula
elements.public static MetadataTools.ColumnNameIterator getColumnNameIterator(Iterator<Column> columnIterator)
public static MetadataTools.ColumnNameIterator getColumnNameIterator(JoinColumn[] joinColumns)
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.