public class AttributeStorageDefinition
extends java.lang.Object
AttributeStorage
Constructor and Description |
---|
AttributeStorageDefinition(java.lang.String... names)
Helper Constructor to use when all the attributes are Strings.
|
AttributeStorageDefinition(java.lang.String[] names,
AttributeClass[] storage)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addDefinition(java.lang.String name,
AttributeClass storage)
Add another attribute name, storage definition pair
|
AttributeStorageDefinition |
createTableSubsetDefinition(java.util.List<java.lang.String> wantedColumns)
Create an ASD from subset of columns in this ASD.
|
boolean |
equals(java.lang.Object o) |
static AttributeStorageDefinition |
expand(AttributeStorageDefinition asd,
java.lang.String addCol,
AttributeClass addClass)
Create a new ASD from existing ASD.
|
AttributeClass[] |
getClasses() |
java.util.Iterator<java.lang.String> |
getNameIterator()
Return a Iterator through the attribute names.
|
java.lang.String[] |
getNames() |
java.lang.String |
getSelectColumns()
Gives the list of column names defined, separated by commas & ready for a select statement
|
AttributeClass |
getStorageClass(java.lang.String attrName)
Gets the storage class for an attribute and also validates
that the attribute name is recognized.
|
static AttributeStorageDefinition |
getTableASD(java.sql.Connection con,
java.lang.String tablename)
Get the persistent attributes of the named table and their AttributeClass.
|
boolean |
hasAttribute(java.lang.String attrName)
Is there an attribute defined with this name?
|
static AttributeStorageDefinition |
reduce(AttributeStorageDefinition asd,
java.lang.String... removeAttrs)
Create a new ASD from an existing ASD without the named attributes.
|
java.lang.String |
toString() |
public AttributeStorageDefinition(java.lang.String[] names, AttributeClass[] storage)
names
- The names of the attributesstorage
- How to store the attribute values. If this parameter is null, all the attributes
are assumed to be Strings.public AttributeStorageDefinition(java.lang.String... names)
names
- The names of the attributespublic AttributeClass getStorageClass(java.lang.String attrName)
attrName
- The Name of the attribute.java.lang.RuntimeException
- If attribute named doesn't exist.public boolean hasAttribute(java.lang.String attrName)
attrName
- The name of the attribute to check for.public java.util.Iterator<java.lang.String> getNameIterator()
public java.lang.String[] getNames()
public AttributeClass[] getClasses()
public void addDefinition(java.lang.String name, AttributeClass storage)
name
- Name of the attributestorage
- Storage Classpublic java.lang.String getSelectColumns()
public java.lang.String toString()
toString
in class java.lang.Object
public static AttributeStorageDefinition expand(AttributeStorageDefinition asd, java.lang.String addCol, AttributeClass addClass)
asd
- The ASD to build from. This can be null.addCol
- The column to add to the ASDaddClass
- The class of the column addedpublic static AttributeStorageDefinition reduce(AttributeStorageDefinition asd, java.lang.String... removeAttrs)
No error if any attribute name isn't found.
asd
- The original ASDremoveAttrs
- The attributes to not include in the new ASD.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static AttributeStorageDefinition getTableASD(java.sql.Connection con, java.lang.String tablename) throws java.sql.SQLException
tablename
- java.sql.SQLException
public AttributeStorageDefinition createTableSubsetDefinition(java.util.List<java.lang.String> wantedColumns)
wantedColumns
- List of columns to include in the ASD