Java Doc for Column.java in  » Database-ORM » Torque » org » apache » torque » engine » database » model » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Torque » org.apache.torque.engine.database.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.torque.engine.database.model.Column

Column
public class Column (Code)
A Class for holding data about a column used in an Application.
author:
   Leon Messerschmidt
author:
   Jason van Zyl
author:
   Jon S. Stevens
author:
   Daniel Rall
author:
   Martin Poeschl
author:
   Column()
     Creates a new instance with a null name.
public  Column(String name)
    

Method Summary
public  InheritanceaddInheritance(Attributes attrib)
     A utility function to create a new column from attrib and add it to this table.
public  voidaddInheritance(Inheritance inh)
    
public  voidaddOption(String key, String value)
     Add an XML Specified option key/value pair to this element's option set.
public  voidaddReferrer(ForeignKey fk)
     Adds the foreign key from another table that refers to this column.
public  StringgetAutoIncrementString()
    
public  ListgetChildren()
     Get the inheritance definitions.
public  StringgetDefaultSetting()
     Return a string that will give this column a default value.
public  StringgetDefaultValue()
     Get a string that will give this column a default value.
public  StringgetDescription()
    
public  DomaingetDomain()
    
public  ForeignKeygetForeignKey()
    
public  StringgetFullyQualifiedName()
    
public  StringgetGetterName()
    
public  StringgetInheritanceType()
     Get the value of the inheritance attribute defined in the schema XML.
public  StringgetInputValidator()
    
public  StringgetJavaName()
     Get name to use in Java sources to build method names.
public  StringgetJavaNative()
     Return a string representation of the native java type which corresponds to the JDBC type of this column.
public  StringgetJavaObject()
     Return a string representation of the Java object which corresponds to the JDBC type of this column.
public  StringgetJavaPrimitive()
     Return a string representation of the primitive java type which corresponds to the JDBC type of this column.
public  StringgetJavaType()
     Returns whether the type in the java object should be an object or primitive.
public  StringgetName()
    
public  StringgetNotNullString()
    
public  StringgetOption(String key)
     Get the value that was associated with this key in an XML option element.
Parameters:
  key - the key of the option.
public  MapgetOptions()
     Gets the full ordered hashtable array of items specified by XML option statements under this element.

Note, this is not thread save but since it's only used for generation which is single threaded, there should be minimum danger using this in Velocity. An Map of all options.

public  StringgetParameterParserMethod()
     Return ParameterParser getX() method which corresponds to the JDBC type which represents this column.
public  StringgetPeerJavaName()
     Returns the name of the constant that is used for the column in the Peer class, e.g., RecordPeer.COLVARNAME. Generally this will be a straight conversion to upper case. But if the column name is equals to TABLE_NAME or DATABASE_NAME (Torque predefined vars), the column name will have an _ prefixed, e.g.
public  intgetPosition()
     Get the location of this column within the table (one-based).
public  StringgetPrecision()
     Try to determine the precision of the field from the size attribute.
public  ListgetReferrers()
     Get list of references to this column.
public  StringgetRelatedColumnName()
     Utility method to get the related column of this local column if this column is a foreign key or part of a foreign key.
public  StringgetRelatedTableName()
    
public  StringgetScale()
     Try to determine the scale of the field from the scale and size attribute.
public  StringgetSetterName()
    
public  StringgetSize()
    
public  StringgetSqlString()
    
public  TablegetTable()
    
public  StringgetTableName()
    
public  ObjectgetTorqueType()
    
public  ObjectgetType()
    
public  StringgetUncapitalisedJavaName()
    
public  StringgetVillageMethod()
     Return Village asX() method which corresponds to the JDBC type which represents this column.
public  booleanisAutoIncrement()
     Return auto increment/sequence string for the target database.
public  booleanisBit()
     Returns true if the column type is boolean in the java object and a Bit ("1" or "0") in the db.
public  booleanisBooleanChar()
     Returns true if the column type is boolean in the java object and a String ("Y" or "N") in the db.
public  booleanisBooleanInt()
     Returns true if the column type is boolean in the java object and a numeric (1 or 0) in the db.
public  booleanisCorrectGetters()
    
public  booleanisEnumeratedClasses()
     Determine if possible classes have been enumerated in the xml file.
public  booleanisForeignKey()
     Utility method to determine if this column is a foreign key.
public  booleanisInheritance()
     Determine if this column is a normal property or specifies a the classes that are represented in the table containing this column.
public  booleanisMultipleFK()
     Determine if this column is a foreign key that refers to the same table as another foreign key column in this table.
public  booleanisNotNull()
    
public  booleanisPrimaryKey()
    
public  booleanisPrimitive()
    
public  booleanisProtected()
    
public  booleanisString()
    
public  booleanisUnique()
    
public  booleanisUsePrimitive()
    
public  voidloadFromXML(Attributes attrib)
    
public static  StringmakeList(List columns)
     Return a comma delimited string listing the specified columns.
public  booleanneedEscapedValue()
     Utility method to return the value as an element to be usable in an SQL insert statement.
public  StringprintSize()
     Return the size and scale in brackets for use in an sql schema.
public  booleanrequiresTransactionInPostgres()
    
public  voidsetAutoIncrement(boolean value)
     Set the auto increment value.
public  voidsetCorrectGetters(boolean correctGetters)
     Set the correctGetters property of the column.
public  voidsetDefaultValue(String def)
     Set a string that will give this column a default value.
public  voidsetDescription(String newDescription)
    
public  voidsetDomain(Domain domain)
    
public  voidsetJavaName(String javaName)
     Set the name to use in Java sources.
public  voidsetName(String newName)
    
public  voidsetNotNull(boolean status)
    
public  voidsetPosition(int v)
     Get the location of this column within the table (one-based).
public  voidsetPrimaryKey(boolean pk)
    
public  voidsetProtected(boolean prot)
    
public  voidsetScale(String newScale)
    
public  voidsetSize(String newSize)
    
public  voidsetTable(Table parent)
    
public  voidsetType(String torqueType)
    
public  voidsetType(SchemaType torqueType)
    
public  voidsetTypeFromString(String typeName, String size)
    
public  voidsetUnique(boolean u)
    
public  StringtoString()
     String representation of the column.


Constructor Detail
Column
public Column()(Code)
Creates a new instance with a null name.



Column
public Column(String name)(Code)
Creates a new column and set the name
Parameters:
  name - column name




Method Detail
addInheritance
public Inheritance addInheritance(Attributes attrib)(Code)
A utility function to create a new column from attrib and add it to this table.



addInheritance
public void addInheritance(Inheritance inh)(Code)
Adds a new inheritance definition to the inheritance list and set the parent column of the inheritance to the current column



addOption
public void addOption(String key, String value)(Code)
Add an XML Specified option key/value pair to this element's option set.
Parameters:
  key - the key of the option.
Parameters:
  value - the value of the option.



addReferrer
public void addReferrer(ForeignKey fk)(Code)
Adds the foreign key from another table that refers to this column.



getAutoIncrementString
public String getAutoIncrementString()(Code)



getChildren
public List getChildren()(Code)
Get the inheritance definitions.



getDefaultSetting
public String getDefaultSetting()(Code)
Return a string that will give this column a default value.



getDefaultValue
public String getDefaultValue()(Code)
Get a string that will give this column a default value.



getDescription
public String getDescription()(Code)
Get the description for the Table



getDomain
public Domain getDomain()(Code)
Returns the domain.



getForeignKey
public ForeignKey getForeignKey()(Code)
get the foreign key object for this column if it is a foreign key or part of a foreign key



getFullyQualifiedName
public String getFullyQualifiedName()(Code)
Returns table.column



getGetterName
public String getGetterName()(Code)
Returns the name for the getter method to retrieve the value of this column A getter method name for this column.
since:
   3.2



getInheritanceType
public String getInheritanceType()(Code)
Get the value of the inheritance attribute defined in the schema XML. Returns the inheritanceType.



getInputValidator
public String getInputValidator()(Code)
Returns the class name to do input validation



getJavaName
public String getJavaName()(Code)
Get name to use in Java sources to build method names. the capitalised javaName



getJavaNative
public String getJavaNative()(Code)
Return a string representation of the native java type which corresponds to the JDBC type of this column. Use in the generation of Base objects. This method is used by torque, so it returns Key types for primaryKey and foreignKey columns java datatype used by torque



getJavaObject
public String getJavaObject()(Code)
Return a string representation of the Java object which corresponds to the JDBC type of this column. Use in the generation of MapBuilders.



getJavaPrimitive
public String getJavaPrimitive()(Code)
Return a string representation of the primitive java type which corresponds to the JDBC type of this column. string representation of the primitive java type



getJavaType
public String getJavaType()(Code)
Returns whether the type in the java object should be an object or primitive.



getName
public String getName()(Code)
Get the name of the column



getNotNullString
public String getNotNullString()(Code)
Return NOT NULL String for this column "NOT NULL" if null values are not allowed or an empty String.



getOption
public String getOption(String key)(Code)
Get the value that was associated with this key in an XML option element.
Parameters:
  key - the key of the option. The value for the key or a null.



getOptions
public Map getOptions()(Code)
Gets the full ordered hashtable array of items specified by XML option statements under this element.

Note, this is not thread save but since it's only used for generation which is single threaded, there should be minimum danger using this in Velocity. An Map of all options. Will not be null but may be empty.




getParameterParserMethod
public String getParameterParserMethod()(Code)
Return ParameterParser getX() method which corresponds to the JDBC type which represents this column.



getPeerJavaName
public String getPeerJavaName()(Code)
Returns the name of the constant that is used for the column in the Peer class, e.g., RecordPeer.COLVARNAME. Generally this will be a straight conversion to upper case. But if the column name is equals to TABLE_NAME or DATABASE_NAME (Torque predefined vars), the column name will have an _ prefixed, e.g. _TABLE_NAME.

TODO: Handle delimited column names that have non-Java identifier characters in them. The name to use in defining the Peer class column variable.




getPosition
public int getPosition()(Code)
Get the location of this column within the table (one-based). value of position.



getPrecision
public String getPrecision()(Code)
Try to determine the precision of the field from the size attribute. If size attribute is an integer number, it will be returned. If size attribute is of the format "Precision,Scale", then Precision will be returned. If size is null or the size value is not an valid integer, null is returned.

Note: Unparseable values will be logged as a warning. The precision portion of the size attribute.




getReferrers
public List getReferrers()(Code)
Get list of references to this column.



getRelatedColumnName
public String getRelatedColumnName()(Code)
Utility method to get the related column of this local column if this column is a foreign key or part of a foreign key.



getRelatedTableName
public String getRelatedTableName()(Code)
Utility method to get the related table of this column if it is a foreign key or part of a foreign key



getScale
public String getScale()(Code)
Try to determine the scale of the field from the scale and size attribute. If scale attribute is an integer number, it will be returned. If size attribute is of the format "Precision,Scale", then Scale will be returned. If scale and size attributes are null or the scale value found is not an valid integer, a null value is returned.

Note: Unparseable values will be logged as a warning. The precision portion of the size attribute.




getSetterName
public String getSetterName()(Code)
Returns the name for the setter method to set the value of this column A setter method name for this column.
since:
   3.2



getSize
public String getSize()(Code)
Returns the size of the column



getSqlString
public String getSqlString()(Code)



getTable
public Table getTable()(Code)
Get the parent Table of the column



getTableName
public String getTableName()(Code)
Returns the Name of the table the column is in



getTorqueType
public Object getTorqueType()(Code)
Returns the column type as given in the schema as an object



getType
public Object getType()(Code)
Returns the column jdbc type as an object



getUncapitalisedJavaName
public String getUncapitalisedJavaName()(Code)
Get variable name to use in Java sources (= uncapitalised java name)



getVillageMethod
public String getVillageMethod()(Code)
Return Village asX() method which corresponds to the JDBC type which represents this column.



isAutoIncrement
public boolean isAutoIncrement()(Code)
Return auto increment/sequence string for the target database. We need to pass in the props for the target database!



isBit
public boolean isBit()(Code)
Returns true if the column type is boolean in the java object and a Bit ("1" or "0") in the db.



isBooleanChar
public boolean isBooleanChar()(Code)
Returns true if the column type is boolean in the java object and a String ("Y" or "N") in the db.



isBooleanInt
public boolean isBooleanInt()(Code)
Returns true if the column type is boolean in the java object and a numeric (1 or 0) in the db.



isCorrectGetters
public boolean isCorrectGetters()(Code)
Return the correctGetters property of the column The currentValue of the correctGetters property.
since:
   3.2



isEnumeratedClasses
public boolean isEnumeratedClasses()(Code)
Determine if possible classes have been enumerated in the xml file.



isForeignKey
public boolean isForeignKey()(Code)
Utility method to determine if this column is a foreign key.



isInheritance
public boolean isInheritance()(Code)
Determine if this column is a normal property or specifies a the classes that are represented in the table containing this column.



isMultipleFK
public boolean isMultipleFK()(Code)
Determine if this column is a foreign key that refers to the same table as another foreign key column in this table.



isNotNull
public boolean isNotNull()(Code)
Return the isNotNull property of the column



isPrimaryKey
public boolean isPrimaryKey()(Code)
Return true if the column is a primary key



isPrimitive
public boolean isPrimitive()(Code)
returns true, if the columns java native type is an boolean, byte, short, int, long, float, double, char



isProtected
public boolean isProtected()(Code)
Return the isProtected property of the column



isString
public boolean isString()(Code)
Utility method to see if the column is a string



isUnique
public boolean isUnique()(Code)
Get the UNIQUE property



isUsePrimitive
public boolean isUsePrimitive()(Code)



loadFromXML
public void loadFromXML(Attributes attrib)(Code)
Imports a column from an XML specification



makeList
public static String makeList(List columns)(Code)
Return a comma delimited string listing the specified columns.
Parameters:
  columns - Either a list of Column objects, ora list of String objects with column names.



needEscapedValue
public boolean needEscapedValue()(Code)
Utility method to return the value as an element to be usable in an SQL insert statement. This is used from the SQL loader task



printSize
public String printSize()(Code)
Return the size and scale in brackets for use in an sql schema. size and scale or an empty String if there are no valuesavailable.



requiresTransactionInPostgres
public boolean requiresTransactionInPostgres()(Code)
Return true if the column requires a transaction in Postgres



setAutoIncrement
public void setAutoIncrement(boolean value)(Code)
Set the auto increment value. Use isAutoIncrement() to find out if it is set or not.



setCorrectGetters
public void setCorrectGetters(boolean correctGetters)(Code)
Set the correctGetters property of the column. If set to true, the column returns is<xxx> as the getter name which is correct for the Bean Specs but incompatible to pre-3.2 releases.
Parameters:
  correctGetters - The new value of the correctGetters property.
since:
   3.2



setDefaultValue
public void setDefaultValue(String def)(Code)
Set a string that will give this column a default value.



setDescription
public void setDescription(String newDescription)(Code)
Set the description for the Table
Parameters:
  newDescription - description for the Table



setDomain
public void setDomain(Domain domain)(Code)

Parameters:
  domain - The domain to set.



setJavaName
public void setJavaName(String javaName)(Code)
Set the name to use in Java sources.



setName
public void setName(String newName)(Code)
Set the name of the column



setNotNull
public void setNotNull(boolean status)(Code)
Set the isNotNull property of the column



setPosition
public void setPosition(int v)(Code)
Get the location of this column within the table (one-based).
Parameters:
  v - Value to assign to position.



setPrimaryKey
public void setPrimaryKey(boolean pk)(Code)
Set if the column is a primary key or not



setProtected
public void setProtected(boolean prot)(Code)
Set the isProtected property of the Column



setScale
public void setScale(String newScale)(Code)
Set the scale of the column



setSize
public void setSize(String newSize)(Code)
Set the size of the column



setTable
public void setTable(Table parent)(Code)
Set the parent Table of the column



setType
public void setType(String torqueType)(Code)
Sets the colunm type



setType
public void setType(SchemaType torqueType)(Code)
Sets the colunm type



setTypeFromString
public void setTypeFromString(String typeName, String size)(Code)
Set the column type from a string property (normally a string from an sql input file)



setUnique
public void setUnique(boolean u)(Code)
Set true if the column is UNIQUE



toString
public String toString()(Code)
String representation of the column. This is an xml representation. string representation in xml



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.