Java Doc for MappingInfo.java in  » Database-ORM » openjpa » org » apache » openjpa » jdbc » meta » 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 » openjpa » org.apache.openjpa.jdbc.meta 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.openjpa.jdbc.meta.MappingInfo

All known Subclasses:   org.apache.openjpa.jdbc.meta.FieldMappingInfo,  org.apache.openjpa.jdbc.meta.VersionMappingInfo,  org.apache.openjpa.jdbc.meta.ClassMappingInfo,  org.apache.openjpa.jdbc.meta.ValueMappingInfo,  org.apache.openjpa.jdbc.meta.DiscriminatorMappingInfo,
MappingInfo
abstract public class MappingInfo implements Serializable(Code)
Base class storing raw mapping information; defines utility methods for converting raw mapping information to full mapping to the schema.
author:
   Abe White

Inner Class :public static interface TableDefaults
Inner Class :public static interface ForeignKeyDefaults

Field Summary
final public static  intJOIN_FORWARD
    
final public static  intJOIN_INVERSE
    
final public static  intJOIN_NONE
    


Method Summary
public  voidassertNoForeignKey(MetaDataContext context, boolean die)
     Assert that the user did not try to place a foreign key on this mapping.
public  voidassertNoIndex(MetaDataContext context, boolean die)
     Assert that the user did not try to place an index on this mapping.
public  voidassertNoJoin(MetaDataContext context, boolean die)
     Assert that the user did not try to join.
public  voidassertNoSchemaComponents(MetaDataContext context, boolean die)
     Assert that the user did not supply any columns, index, unique constraint, or foreign key for this mapping.
public  voidassertNoUnique(MetaDataContext context, boolean die)
     Assert that the user did not try to place a unique constraint on this mapping.
public  voidassertStrategy(MetaDataContext context, Object contextStrat, Object expected, boolean die)
     Assert that this info has the given strategy or no strategy.
public  booleancanForeignKey()
     The user can mark columns as explicitly not having a foreign key.
public  booleancanIndex()
     The user can mark columns as explicitly non-indexable.
public  booleancanUnique()
     The user can mark columns as explicitly not having a unique constraint.
public  voidclear()
     Clear all mapping information.
protected  voidclear(boolean canFlags)
     Clear mapping information.
public  voidcopy(MappingInfo info)
     Copy missing info from the instance to this one.
protected  Column[]createColumns(MetaDataContext context, String prefix, Column[] tmplates, Table table, boolean adapt)
     Retrieve/create columns on the given table by merging the given template information with any user-provided information.
protected  ForeignKeycreateForeignKey(MetaDataContext context, String prefix, List given, ForeignKeyDefaults def, Table table, ClassMapping cls, ClassMapping rel, boolean inversable, boolean adapt)
     Retrieve/create a foreign key (possibly logical) on the given columns by merging the given template information with any user-provided information.
protected  IndexcreateIndex(MetaDataContext context, String prefix, Index tmplate, Column[] cols, boolean adapt)
     Retrieve/create an index on the given columns by merging the given template information with any user-provided information.
public  TablecreateTable(MetaDataContext context, TableDefaults def, String schemaName, String given, boolean adapt)
     Find or generate a table for a mapping.
protected  UniquecreateUnique(MetaDataContext context, String prefix, Unique tmplate, Column[] cols, boolean adapt)
     Retrieve/create a unique constraint on the given columns by merging the given template information with any user-provided information.
public  ColumnIOgetColumnIO()
     I/O for the columns created by the last call to MappingInfo.createColumns , or for the foreign key created by the last call to MappingInfo.createForeignKey .
public  ListgetColumns()
     Raw column data.
public  ForeignKeygetForeignKey()
     Raw foreign key information.
public  IndexgetIndex()
     Raw index.
public  intgetJoinDirection()
     Direction of the join that the columns of this mapping info form.
public  StringgetStrategy()
     Mapping strategy name.
public  UniquegetUnique()
     Raw unique constraint information.
public  booleanhasSchemaComponents()
     Return true if this info has columns, foreign key information, index information, etc.
protected static  ColumnmergeColumn(MetaDataContext context, String prefix, Column tmplate, boolean compat, Column given, Table table, boolean adapt, boolean fill)
     Merge the given columns if possible.
public  voidsetCanForeignKey(boolean fkable)
     The user can mark columns as explicitly not having a foreign key.
public  voidsetCanIndex(boolean indexable)
     The user can mark columns as explicitly non-indexable.
public  voidsetCanUnique(boolean uniquable)
     The user can mark columns as explicitly not having a unique constraint.
public  voidsetColumnIO(ColumnIO io)
     I/O for the columns created by the last call to MappingInfo.createColumns , or for the foreign key created by the last call to MappingInfo.createForeignKey .
public  voidsetColumns(List cols)
     Raw column data.
public  voidsetForeignKey(ForeignKey fk)
     Raw foreign key information.
public  voidsetIndex(Index idx)
     Raw index.
public  voidsetJoinDirection(int join)
     Direction of the join that the columns of this mapping info form.
public  voidsetStrategy(String strategy)
     Mapping strategy name.
public  voidsetUnique(Unique unq)
     Raw unique constraint information.
protected static  ColumnsyncColumn(MetaDataContext context, Column col, int num, boolean forceJDBCType, Table colTable, Table targetTable, Object target, boolean inverse)
     Create a copy of the given column with the raw mapping information set correctly, and without settings that match defaults.
protected  voidsyncColumns(MetaDataContext context, Column[] cols, boolean forceJDBCType)
     Sets internal column information to match the given mapped columns.
protected  voidsyncForeignKey(MetaDataContext context, ForeignKey fk, Table local, Table target)
     Sets internal constraint and column information to match given mapped constraint.
protected  voidsyncIndex(MetaDataContext context, Index idx)
     Sets internal index information to match given mapped index.
protected  voidsyncUnique(MetaDataContext context, Unique unq)
     Sets internal constraint information to match given mapped constraint.

Field Detail
JOIN_FORWARD
final public static int JOIN_FORWARD(Code)



JOIN_INVERSE
final public static int JOIN_INVERSE(Code)



JOIN_NONE
final public static int JOIN_NONE(Code)





Method Detail
assertNoForeignKey
public void assertNoForeignKey(MetaDataContext context, boolean die)(Code)
Assert that the user did not try to place a foreign key on this mapping.



assertNoIndex
public void assertNoIndex(MetaDataContext context, boolean die)(Code)
Assert that the user did not try to place an index on this mapping.



assertNoJoin
public void assertNoJoin(MetaDataContext context, boolean die)(Code)
Assert that the user did not try to join.



assertNoSchemaComponents
public void assertNoSchemaComponents(MetaDataContext context, boolean die)(Code)
Assert that the user did not supply any columns, index, unique constraint, or foreign key for this mapping.



assertNoUnique
public void assertNoUnique(MetaDataContext context, boolean die)(Code)
Assert that the user did not try to place a unique constraint on this mapping.



assertStrategy
public void assertStrategy(MetaDataContext context, Object contextStrat, Object expected, boolean die)(Code)
Assert that this info has the given strategy or no strategy.



canForeignKey
public boolean canForeignKey()(Code)
The user can mark columns as explicitly not having a foreign key.



canIndex
public boolean canIndex()(Code)
The user can mark columns as explicitly non-indexable.



canUnique
public boolean canUnique()(Code)
The user can mark columns as explicitly not having a unique constraint.



clear
public void clear()(Code)
Clear all mapping information.



clear
protected void clear(boolean canFlags)(Code)
Clear mapping information.
Parameters:
  canFlags - whether to clear information about whether wecan place indexed, foreign keys, etc on this mapping



copy
public void copy(MappingInfo info)(Code)
Copy missing info from the instance to this one.



createColumns
protected Column[] createColumns(MetaDataContext context, String prefix, Column[] tmplates, Table table, boolean adapt)(Code)
Retrieve/create columns on the given table by merging the given template information with any user-provided information.
Parameters:
  context - the mapping we're retrieving columns for
Parameters:
  prefix - localized error message key prefix
Parameters:
  tmplates - template columns
Parameters:
  table - the table for the columns
Parameters:
  adapt - whether we can modify the existing mapping or schema



createForeignKey
protected ForeignKey createForeignKey(MetaDataContext context, String prefix, List given, ForeignKeyDefaults def, Table table, ClassMapping cls, ClassMapping rel, boolean inversable, boolean adapt)(Code)
Retrieve/create a foreign key (possibly logical) on the given columns by merging the given template information with any user-provided information.
Parameters:
  context - the mapping we're retrieving a key for
Parameters:
  prefix - localized error message key prefix
Parameters:
  given - the columns given by the user
Parameters:
  def - defaults provider
Parameters:
  table - the table for the key
Parameters:
  cls - type we're joining from
Parameters:
  rel - target type we're joining to
Parameters:
  inversable - whether the foreign key can be inversed
Parameters:
  adapt - whether we can modify the existing mapping or schema



createIndex
protected Index createIndex(MetaDataContext context, String prefix, Index tmplate, Column[] cols, boolean adapt)(Code)
Retrieve/create an index on the given columns by merging the given template information with any user-provided information.
Parameters:
  context - the mapping we're retrieving an index for
Parameters:
  prefix - localized error message key prefix
Parameters:
  tmplate - template for expected index information
Parameters:
  cols - the indexed columns
Parameters:
  adapt - whether we can modify the existing mapping or schema



createTable
public Table createTable(MetaDataContext context, TableDefaults def, String schemaName, String given, boolean adapt)(Code)
Find or generate a table for a mapping.
Parameters:
  context - the mapping that uses the table
Parameters:
  def - default table name provider
Parameters:
  schemaName - default schema if known, or null
Parameters:
  given - given table name
Parameters:
  adapt - whether we can alter the schema or mappings



createUnique
protected Unique createUnique(MetaDataContext context, String prefix, Unique tmplate, Column[] cols, boolean adapt)(Code)
Retrieve/create a unique constraint on the given columns by merging the given template information with any user-provided information.
Parameters:
  context - the mapping we're retrieving a constraint for
Parameters:
  prefix - localized error message key prefix
Parameters:
  tmplate - template for expected unique information
Parameters:
  cols - the constraint columns
Parameters:
  adapt - whether we can modify the existing mapping or schema



getColumnIO
public ColumnIO getColumnIO()(Code)
I/O for the columns created by the last call to MappingInfo.createColumns , or for the foreign key created by the last call to MappingInfo.createForeignKey . This is also expected to be set correctly prior to calls to MappingInfo.syncColumns and MappingInfo.syncForeignKey .



getColumns
public List getColumns()(Code)
Raw column data.



getForeignKey
public ForeignKey getForeignKey()(Code)
Raw foreign key information.



getIndex
public Index getIndex()(Code)
Raw index.



getJoinDirection
public int getJoinDirection()(Code)
Direction of the join that the columns of this mapping info form. This is usually automatically set by MappingInfo.createForeignKey . This flag is also expected to be set correctly prior to calls to MappingInfo.syncForeignKey if the join is inversed.



getStrategy
public String getStrategy()(Code)
Mapping strategy name.



getUnique
public Unique getUnique()(Code)
Raw unique constraint information.



hasSchemaComponents
public boolean hasSchemaComponents()(Code)
Return true if this info has columns, foreign key information, index information, etc.



mergeColumn
protected static Column mergeColumn(MetaDataContext context, String prefix, Column tmplate, boolean compat, Column given, Table table, boolean adapt, boolean fill)(Code)
Merge the given columns if possible.
Parameters:
  context - the mapping we're retrieving columns for
Parameters:
  prefix - localized error message key prefix
Parameters:
  tmplate - template for expected column information
Parameters:
  compat - whether the existing column type must be compatiblewith the type of the template column
Parameters:
  given - the given column information from mapping info
Parameters:
  table - the table for the columns
Parameters:
  adapt - whether we can modify the existing mapping or schema
Parameters:
  fill - whether to default missing column information



setCanForeignKey
public void setCanForeignKey(boolean fkable)(Code)
The user can mark columns as explicitly not having a foreign key.



setCanIndex
public void setCanIndex(boolean indexable)(Code)
The user can mark columns as explicitly non-indexable.



setCanUnique
public void setCanUnique(boolean uniquable)(Code)
The user can mark columns as explicitly not having a unique constraint.



setColumnIO
public void setColumnIO(ColumnIO io)(Code)
I/O for the columns created by the last call to MappingInfo.createColumns , or for the foreign key created by the last call to MappingInfo.createForeignKey . This is also expected to be set correctly prior to calls to MappingInfo.syncColumns and MappingInfo.syncForeignKey .



setColumns
public void setColumns(List cols)(Code)
Raw column data.



setForeignKey
public void setForeignKey(ForeignKey fk)(Code)
Raw foreign key information.



setIndex
public void setIndex(Index idx)(Code)
Raw index.



setJoinDirection
public void setJoinDirection(int join)(Code)
Direction of the join that the columns of this mapping info form. This is usually automatically set by MappingInfo.createForeignKey . This flag is also expected to be set correctly prior to calls to MappingInfo.syncForeignKey if the join is inversed.



setStrategy
public void setStrategy(String strategy)(Code)
Mapping strategy name.



setUnique
public void setUnique(Unique unq)(Code)
Raw unique constraint information.



syncColumn
protected static Column syncColumn(MetaDataContext context, Column col, int num, boolean forceJDBCType, Table colTable, Table targetTable, Object target, boolean inverse)(Code)
Create a copy of the given column with the raw mapping information set correctly, and without settings that match defaults.
Parameters:
  num - the number of columns for this mapping
Parameters:
  forceJDBCType - whether the jdbc-type of the created columnshould be set, even if it matches the defaultfor the given column's java type
Parameters:
  colTable - expected table for the column
Parameters:
  targetTable - expected target table for join column
Parameters:
  target - target column or object for join column; for aconstant null target, use MappingInfo.NULL
Parameters:
  inverse - whether join column is for inverse join



syncColumns
protected void syncColumns(MetaDataContext context, Column[] cols, boolean forceJDBCType)(Code)
Sets internal column information to match the given mapped columns.
Parameters:
  forceJDBCType - whether to force the jdbc-type of the columnsto be set, even when it matches the default for the columns' java type



syncForeignKey
protected void syncForeignKey(MetaDataContext context, ForeignKey fk, Table local, Table target)(Code)
Sets internal constraint and column information to match given mapped constraint.
Parameters:
  local - default local table
Parameters:
  target - default target table



syncIndex
protected void syncIndex(MetaDataContext context, Index idx)(Code)
Sets internal index information to match given mapped index.



syncUnique
protected void syncUnique(MetaDataContext context, Unique unq)(Code)
Sets internal constraint information to match given mapped constraint.



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.