Java Doc for DatabaseMap.java in  » Database-ORM » Torque » org » apache » torque » map » 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.map 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.torque.map.DatabaseMap

DatabaseMap
public class DatabaseMap implements java.io.Serializable(Code)
DatabaseMap is used to model a database.
author:
   John D. McNally
author:
   Daniel Rall
author:
   Greg Monroe
version:
   $Id: DatabaseMap.java 476550 2006-11-18 16:08:37Z tfischer $


Field Summary
final protected static  String[]ERROR_MESSAGES_INIT
     Error Messages for initialisation.
final public static  StringINIT_CLASS_NAME_FORMAT
    
final public static  charSCHEMA_SEPARATOR_CHAR
     The character which separates the schema name from the table name.
final public static  charSTD_SEPARATOR_CHAR
     The character used by most implementations as the separator between name elements.

Constructor Summary
public  DatabaseMap()
     Constructs a new DatabaseMap.
public  DatabaseMap(String name, int numberOfTables)
     Constructor.
public  DatabaseMap(String name)
     Constructor.

Method Summary
public  voidaddIdGenerator(String type, IdGenerator idGen)
     Add a type of id generator for access by a TableMap.
public  voidaddTable(String tableName)
     Add a new table to the database by name.
public  voidaddTable(String tableName, int numberOfColumns)
     Add a new table to the database by name.
public  voidaddTable(TableMap map)
     Add a new TableMap to the database.
public  booleancontainsTable(TableMap table)
     Does this database contain this specific table?
Parameters:
  table - The TableMap representation of the table.
public  booleancontainsTable(String name)
     Does this database contain this specific table?
Parameters:
  name - The String representation of the table.
public  IDBrokergetIDBroker()
     Get the IDBroker for this database.
public  IdGeneratorgetIdGenerator(String type)
     Get a type of id generator.
public  TableMapgetIdTable()
     Get the ID table for this database.
public  StringgetName()
     Get the name of this database.
public  TableMapgetTable(String name)
     Get a TableMap for the table by name.
public  TableMap[]getTables()
     Get a TableMap[] of all of the tables in the database.

Note that by default Torque uses lazy initialization to minimize memory usage and startup time.

public synchronized  voidinitialize()
     Fully populate this DatabaseMap with all the TablesMaps.
protected  StringjavanameMethod(String schemaName)
     Converts a database schema name to java object name.
public  voidsetIdTable(TableMap idTable)
     Set the ID table for this database.
public  voidsetIdTable(String tableName)
     Set the ID table for this database.
public synchronized  booleanstartIdBroker()
     Creates the Idbroker for this DatabaseMap.

Field Detail
ERROR_MESSAGES_INIT
final protected static String[] ERROR_MESSAGES_INIT(Code)
Error Messages for initialisation.



INIT_CLASS_NAME_FORMAT
final public static String INIT_CLASS_NAME_FORMAT(Code)
Format used to create create the class name for initializing a DB specific map



SCHEMA_SEPARATOR_CHAR
final public static char SCHEMA_SEPARATOR_CHAR(Code)
The character which separates the schema name from the table name.



STD_SEPARATOR_CHAR
final public static char STD_SEPARATOR_CHAR(Code)
The character used by most implementations as the separator between name elements.




Constructor Detail
DatabaseMap
public DatabaseMap()(Code)
Constructs a new DatabaseMap.



DatabaseMap
public DatabaseMap(String name, int numberOfTables)(Code)
Constructor.
Parameters:
  name - Name of the database.
Parameters:
  numberOfTables - Number of tables in the database.



DatabaseMap
public DatabaseMap(String name)(Code)
Constructor.
Parameters:
  name - Name of the database.




Method Detail
addIdGenerator
public void addIdGenerator(String type, IdGenerator idGen)(Code)
Add a type of id generator for access by a TableMap.
Parameters:
  type - a String value
Parameters:
  idGen - an IdGenerator value



addTable
public void addTable(String tableName)(Code)
Add a new table to the database by name. It creates an empty TableMap that you need to populate.
Parameters:
  tableName - The name of the table.



addTable
public void addTable(String tableName, int numberOfColumns)(Code)
Add a new table to the database by name. It creates an empty TableMap that you need to populate.
Parameters:
  tableName - The name of the table.
Parameters:
  numberOfColumns - The number of columns in the table.



addTable
public void addTable(TableMap map)(Code)
Add a new TableMap to the database.
Parameters:
  map - The TableMap representation.



containsTable
public boolean containsTable(TableMap table)(Code)
Does this database contain this specific table?
Parameters:
  table - The TableMap representation of the table. True if the database contains the table.



containsTable
public boolean containsTable(String name)(Code)
Does this database contain this specific table?
Parameters:
  name - The String representation of the table. True if the database contains the table.



getIDBroker
public IDBroker getIDBroker()(Code)
Get the IDBroker for this database. An IDBroker.



getIdGenerator
public IdGenerator getIdGenerator(String type)(Code)
Get a type of id generator. Valid values are listed in the org.apache.torque.adapter.IDMethod interface.
Parameters:
  type - a String value an IdGenerator value



getIdTable
public TableMap getIdTable()(Code)
Get the ID table for this database. A TableMap.



getName
public String getName()(Code)
Get the name of this database. A String.



getTable
public TableMap getTable(String name)(Code)
Get a TableMap for the table by name.

Note that by default Torque uses lazy initialization to minimize memory usage and startup time. However, if an OM or PEER class has not called the table's MapBuilder class, it will not be here. See the optional initialize method if you need full OM Mapping.


Parameters:
  name - Name of the table. A TableMap, null if the table was not found.




getTables
public TableMap[] getTables()(Code)
Get a TableMap[] of all of the tables in the database.

Note that by default Torque uses lazy initialization to minimize memory usage and startup time. However, if an OM or PEER class has not called the table's MapBuilder class, it will not be here. See the optional initialize method if you need full OM Mapping.

A TableMap[].




initialize
public synchronized void initialize() throws TorqueException(Code)
Fully populate this DatabaseMap with all the TablesMaps. This is only needed if the application needs to use the complete OM mapping information. Otherwise, the OM Mapping information will be populated as needed by OM and Peer classes. An example of how to initialize the map info from the application:

DatabaseMap dbMap = Torque.getDatabaseMap( dbName ); try { dbMap.initialize(); } catch ( TorqueException e ) { ... error handling } Note that Torque database names are case sensitive and this DB map must be retrieved with the exact name used in the XML schema.

This uses Java reflection methods to locate and run the init() method of a class generated in the org.apache.torque.linkage package with a name based on the XML Database name value, e.g. org.apache.torque.linkage.DefaultMapInit

Some misconfiguration situations that could cause this method to fail are:

It was used with a Torque OM set of classes generated by V3.2 or older;
The class(es) in the org.apache.torque.linkage package were not included with the other generated class files (e.g. the jar file creation process only included com.* and not org.* files).


throws:
  TorqueException - If an error is encountered locating and callingthe init method.




javanameMethod
protected String javanameMethod(String schemaName)(Code)
Converts a database schema name to java object name. Operates same as underscoreMethod but does not convert anything to lowercase. This must match the javaNameMethod in the JavaNameGenerator class in Generator code.
Parameters:
  schemaName - name to be converted. converted name.
See Also:   org.apache.torque.engine.database.model.NameGenerator



setIdTable
public void setIdTable(TableMap idTable)(Code)
Set the ID table for this database.
Parameters:
  idTable - The TableMap representation for the ID table.



setIdTable
public void setIdTable(String tableName)(Code)
Set the ID table for this database.
Parameters:
  tableName - The name for the ID table.



startIdBroker
public synchronized boolean startIdBroker()(Code)
Creates the Idbroker for this DatabaseMap. If an IDBroker already exists for the DatabaseMap, the method does nothing. true if a new IdBroker was created, false otherwise.



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.