Package org.exolab.castor.mapping.xml
Class Sql
- java.lang.Object
-
- org.exolab.castor.mapping.xml.Sql
-
- All Implemented Interfaces:
java.io.Serializable
public class Sql extends java.lang.Object implements java.io.Serializable
The 'sql' element is used to store information about the database column to which a Java object is mapped to.- Version:
- $Revision$ $Date$
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Sql()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addManyKey(int index, java.lang.String vManyKey)
void
addManyKey(java.lang.String vManyKey)
void
addName(int index, java.lang.String vName)
void
addName(java.lang.String vName)
void
deleteReadOnly()
void
deleteTransient()
java.util.Enumeration<? extends java.lang.String>
enumerateManyKey()
Method enumerateManyKey.java.util.Enumeration<? extends java.lang.String>
enumerateName()
Method enumerateName.java.lang.String
getCascading()
Returns the value of field 'cascading'.SqlDirtyType
getDirty()
Returns the value of field 'dirty'.java.lang.String[]
getManyKey()
Method getManyKey.Returns the contents of the collection in an Array.java.lang.String
getManyKey(int index)
Method getManyKey.int
getManyKeyCount()
Method getManyKeyCount.java.lang.String
getManyTable()
Returns the value of field 'manyTable'.java.lang.String[]
getName()
Method getName.Returns the contents of the collection in an Array.java.lang.String
getName(int index)
Method getName.int
getNameCount()
Method getNameCount.boolean
getReadOnly()
Returns the value of field 'readOnly'.boolean
getTransient()
Returns the value of field 'transient'.java.lang.String
getType()
Returns the value of field 'type'.boolean
hasReadOnly()
Method hasReadOnly.boolean
hasTransient()
Method hasTransient.boolean
isReadOnly()
Returns the value of field 'readOnly'.boolean
isTransient()
Returns the value of field 'transient'.boolean
isValid()
Method isValid.java.util.Iterator<? extends java.lang.String>
iterateManyKey()
Method iterateManyKey.java.util.Iterator<? extends java.lang.String>
iterateName()
Method iterateName.void
marshal(java.io.Writer out)
void
marshal(org.xml.sax.ContentHandler handler)
void
removeAllManyKey()
void
removeAllName()
boolean
removeManyKey(java.lang.String vManyKey)
Method removeManyKey.java.lang.String
removeManyKeyAt(int index)
Method removeManyKeyAt.boolean
removeName(java.lang.String vName)
Method removeName.java.lang.String
removeNameAt(int index)
Method removeNameAt.void
setCascading(java.lang.String cascading)
Sets the value of field 'cascading'.void
setDirty(SqlDirtyType dirty)
Sets the value of field 'dirty'.void
setManyKey(int index, java.lang.String vManyKey)
void
setManyKey(java.lang.String[] vManyKeyArray)
void
setManyTable(java.lang.String manyTable)
Sets the value of field 'manyTable'.void
setName(int index, java.lang.String vName)
void
setName(java.lang.String[] vNameArray)
void
setReadOnly(boolean readOnly)
Sets the value of field 'readOnly'.void
setTransient(boolean _transient)
Sets the value of field 'transient'.void
setType(java.lang.String type)
Sets the value of field 'type'.static Sql
unmarshal(java.io.Reader reader)
Method unmarshal.void
validate()
-
-
-
Method Detail
-
addManyKey
public void addManyKey(java.lang.String vManyKey) throws java.lang.IndexOutOfBoundsException
- Parameters:
vManyKey
-- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
addManyKey
public void addManyKey(int index, java.lang.String vManyKey) throws java.lang.IndexOutOfBoundsException
- Parameters:
index
-vManyKey
-- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
addName
public void addName(java.lang.String vName) throws java.lang.IndexOutOfBoundsException
- Parameters:
vName
-- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
addName
public void addName(int index, java.lang.String vName) throws java.lang.IndexOutOfBoundsException
- Parameters:
index
-vName
-- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
deleteReadOnly
public void deleteReadOnly()
-
deleteTransient
public void deleteTransient()
-
enumerateManyKey
public java.util.Enumeration<? extends java.lang.String> enumerateManyKey()
Method enumerateManyKey.- Returns:
- an Enumeration over all possible elements of this collection
-
enumerateName
public java.util.Enumeration<? extends java.lang.String> enumerateName()
Method enumerateName.- Returns:
- an Enumeration over all possible elements of this collection
-
getCascading
public java.lang.String getCascading()
Returns the value of field 'cascading'. The field 'cascading' has the following description: An optional attribute to specify cascading support; possible values are 'none', 'all', 'create', 'delete' and 'update'; it is possible to use more than one of those values (when not using 'all' or 'none'), using whitespace as a delimiter (as in 'create delete').- Returns:
- the value of field 'Cascading'.
-
getDirty
public SqlDirtyType getDirty()
Returns the value of field 'dirty'.- Returns:
- the value of field 'Dirty'.
-
getManyKey
public java.lang.String getManyKey(int index) throws java.lang.IndexOutOfBoundsException
Method getManyKey.- Parameters:
index
-- Returns:
- the value of the java.lang.String at the given index
- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
getManyKey
public java.lang.String[] getManyKey()
Method getManyKey.Returns the contents of the collection in an Array.Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.
- Returns:
- this collection as an Array
-
getManyKeyCount
public int getManyKeyCount()
Method getManyKeyCount.- Returns:
- the size of this collection
-
getManyTable
public java.lang.String getManyTable()
Returns the value of field 'manyTable'. The field 'manyTable' has the following description: An optional attribute to specify the name of the bridge table containing the primary keys of the object on each side of the many to many relationship.- Returns:
- the value of field 'ManyTable'.
-
getName
public java.lang.String getName(int index) throws java.lang.IndexOutOfBoundsException
Method getName.- Parameters:
index
-- Returns:
- the value of the java.lang.String at the given index
- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
getName
public java.lang.String[] getName()
Method getName.Returns the contents of the collection in an Array.Note: Just in case the collection contents are changing in another thread, we pass a 0-length Array of the correct type into the API call. This way we know that the Array returned is of exactly the correct length.
- Returns:
- this collection as an Array
-
getNameCount
public int getNameCount()
Method getNameCount.- Returns:
- the size of this collection
-
getReadOnly
public boolean getReadOnly()
Returns the value of field 'readOnly'.- Returns:
- the value of field 'ReadOnly'.
-
getTransient
public boolean getTransient()
Returns the value of field 'transient'.- Returns:
- the value of field 'Transient'.
-
getType
public java.lang.String getType()
Returns the value of field 'type'. The field 'type' has the following description: An optional attibute used to specify the DB-specific type of the column.- Returns:
- the value of field 'Type'.
-
hasReadOnly
public boolean hasReadOnly()
Method hasReadOnly.- Returns:
- true if at least one ReadOnly has been added
-
hasTransient
public boolean hasTransient()
Method hasTransient.- Returns:
- true if at least one Transient has been added
-
isReadOnly
public boolean isReadOnly()
Returns the value of field 'readOnly'.- Returns:
- the value of field 'ReadOnly'.
-
isTransient
public boolean isTransient()
Returns the value of field 'transient'.- Returns:
- the value of field 'Transient'.
-
isValid
public boolean isValid()
Method isValid.- Returns:
- true if this object is valid according to the schema
-
iterateManyKey
public java.util.Iterator<? extends java.lang.String> iterateManyKey()
Method iterateManyKey.- Returns:
- an Iterator over all possible elements in this collection
-
iterateName
public java.util.Iterator<? extends java.lang.String> iterateName()
Method iterateName.- Returns:
- an Iterator over all possible elements in this collection
-
marshal
public void marshal(java.io.Writer out) throws MarshalException, ValidationException
- Parameters:
out
-- Throws:
MarshalException
- if object is null or if any SAXException is thrown during marshalingValidationException
- if this object is an invalid instance according to the schema
-
marshal
public void marshal(org.xml.sax.ContentHandler handler) throws java.io.IOException, MarshalException, ValidationException
- Parameters:
handler
-- Throws:
java.io.IOException
- if an IOException occurs during marshalingValidationException
- if this object is an invalid instance according to the schemaMarshalException
- if object is null or if any SAXException is thrown during marshaling
-
removeAllManyKey
public void removeAllManyKey()
-
removeAllName
public void removeAllName()
-
removeManyKey
public boolean removeManyKey(java.lang.String vManyKey)
Method removeManyKey.- Parameters:
vManyKey
-- Returns:
- true if the object was removed from the collection.
-
removeManyKeyAt
public java.lang.String removeManyKeyAt(int index)
Method removeManyKeyAt.- Parameters:
index
-- Returns:
- the element removed from the collection
-
removeName
public boolean removeName(java.lang.String vName)
Method removeName.- Parameters:
vName
-- Returns:
- true if the object was removed from the collection.
-
removeNameAt
public java.lang.String removeNameAt(int index)
Method removeNameAt.- Parameters:
index
-- Returns:
- the element removed from the collection
-
setCascading
public void setCascading(java.lang.String cascading)
Sets the value of field 'cascading'. The field 'cascading' has the following description: An optional attribute to specify cascading support; possible values are 'none', 'all', 'create', 'delete' and 'update'; it is possible to use more than one of those values (when not using 'all' or 'none'), using whitespace as a delimiter (as in 'create delete').- Parameters:
cascading
- the value of field 'cascading'.
-
setDirty
public void setDirty(SqlDirtyType dirty)
Sets the value of field 'dirty'.- Parameters:
dirty
- the value of field 'dirty'.
-
setManyKey
public void setManyKey(int index, java.lang.String vManyKey) throws java.lang.IndexOutOfBoundsException
- Parameters:
index
-vManyKey
-- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
setManyKey
public void setManyKey(java.lang.String[] vManyKeyArray)
- Parameters:
vManyKeyArray
-
-
setManyTable
public void setManyTable(java.lang.String manyTable)
Sets the value of field 'manyTable'. The field 'manyTable' has the following description: An optional attribute to specify the name of the bridge table containing the primary keys of the object on each side of the many to many relationship.- Parameters:
manyTable
- the value of field 'manyTable'.
-
setName
public void setName(int index, java.lang.String vName) throws java.lang.IndexOutOfBoundsException
- Parameters:
index
-vName
-- Throws:
java.lang.IndexOutOfBoundsException
- if the index given is outside the bounds of the collection
-
setName
public void setName(java.lang.String[] vNameArray)
- Parameters:
vNameArray
-
-
setReadOnly
public void setReadOnly(boolean readOnly)
Sets the value of field 'readOnly'.- Parameters:
readOnly
- the value of field 'readOnly'.
-
setTransient
public void setTransient(boolean _transient)
Sets the value of field 'transient'.- Parameters:
_transient
-transient
- the value of field 'transient'.
-
setType
public void setType(java.lang.String type)
Sets the value of field 'type'. The field 'type' has the following description: An optional attibute used to specify the DB-specific type of the column.- Parameters:
type
- the value of field 'type'.
-
unmarshal
public static Sql unmarshal(java.io.Reader reader) throws MarshalException, ValidationException
Method unmarshal.- Parameters:
reader
-- Returns:
- the unmarshaled org.exolab.castor.mapping.xml.Sql
- Throws:
MarshalException
- if object is null or if any SAXException is thrown during marshalingValidationException
- if this object is an invalid instance according to the schema
-
validate
public void validate() throws ValidationException
- Throws:
ValidationException
- if this object is an invalid instance according to the schema
-
-