Class Sql

java.lang.Object
org.exolab.castor.mapping.xml.Sql
All Implemented Interfaces:
Serializable

public class Sql extends Object implements 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:
  • Constructor Details

    • Sql

      public Sql()
  • Method Details

    • addManyKey

      public void addManyKey(String vManyKey) throws IndexOutOfBoundsException
      Parameters:
      vManyKey -
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • addManyKey

      public void addManyKey(int index, String vManyKey) throws IndexOutOfBoundsException
      Parameters:
      index -
      vManyKey -
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • addName

      public void addName(String vName) throws IndexOutOfBoundsException
      Parameters:
      vName -
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • addName

      public void addName(int index, String vName) throws IndexOutOfBoundsException
      Parameters:
      index -
      vName -
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • deleteReadOnly

      public void deleteReadOnly()
    • deleteTransient

      public void deleteTransient()
    • enumerateManyKey

      public Enumeration<? extends String> enumerateManyKey()
      Method enumerateManyKey.
      Returns:
      an Enumeration over all possible elements of this collection
    • enumerateName

      public Enumeration<? extends String> enumerateName()
      Method enumerateName.
      Returns:
      an Enumeration over all possible elements of this collection
    • getCascading

      public 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 String getManyKey(int index) throws IndexOutOfBoundsException
      Method getManyKey.
      Parameters:
      index -
      Returns:
      the value of the java.lang.String at the given index
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • getManyKey

      public 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 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 String getName(int index) throws IndexOutOfBoundsException
      Method getName.
      Parameters:
      index -
      Returns:
      the value of the java.lang.String at the given index
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • getName

      public 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 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 Iterator<? extends String> iterateManyKey()
      Method iterateManyKey.
      Returns:
      an Iterator over all possible elements in this collection
    • iterateName

      public Iterator<? extends String> iterateName()
      Method iterateName.
      Returns:
      an Iterator over all possible elements in this collection
    • marshal

      public void marshal(Writer out) throws MarshalException, ValidationException
      Parameters:
      out -
      Throws:
      MarshalException - if object is null or if any SAXException is thrown during marshaling
      ValidationException - if this object is an invalid instance according to the schema
    • marshal

      public void marshal(ContentHandler handler) throws IOException, MarshalException, ValidationException
      Parameters:
      handler -
      Throws:
      IOException - if an IOException occurs during marshaling
      ValidationException - if this object is an invalid instance according to the schema
      MarshalException - if object is null or if any SAXException is thrown during marshaling
    • removeAllManyKey

      public void removeAllManyKey()
    • removeAllName

      public void removeAllName()
    • removeManyKey

      public boolean removeManyKey(String vManyKey)
      Method removeManyKey.
      Parameters:
      vManyKey -
      Returns:
      true if the object was removed from the collection.
    • removeManyKeyAt

      public String removeManyKeyAt(int index)
      Method removeManyKeyAt.
      Parameters:
      index -
      Returns:
      the element removed from the collection
    • removeName

      public boolean removeName(String vName)
      Method removeName.
      Parameters:
      vName -
      Returns:
      true if the object was removed from the collection.
    • removeNameAt

      public String removeNameAt(int index)
      Method removeNameAt.
      Parameters:
      index -
      Returns:
      the element removed from the collection
    • setCascading

      public void setCascading(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, String vManyKey) throws IndexOutOfBoundsException
      Parameters:
      index -
      vManyKey -
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • setManyKey

      public void setManyKey(String[] vManyKeyArray)
      Parameters:
      vManyKeyArray -
    • setManyTable

      public void setManyTable(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, String vName) throws IndexOutOfBoundsException
      Parameters:
      index -
      vName -
      Throws:
      IndexOutOfBoundsException - if the index given is outside the bounds of the collection
    • setName

      public void setName(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(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(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 marshaling
      ValidationException - 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