Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.objectstyle.cayenne.dba
Interface PkGenerator  view PkGenerator download PkGenerator.java

All Known Implementing Classes:
JdbcPkGenerator

public interface PkGenerator

Defines methods to support automatic primary key generation.


Method Summary
 void createAutoPk(org.objectstyle.cayenne.access.DataNode node, java.util.List dbEntities)
          Generates necessary database objects to provide automatic primary key support.
 java.util.List createAutoPkStatements(java.util.List dbEntities)
          Returns a list of SQL strings needed to generates database objects to provide automatic primary support for the list of entities.
 void dropAutoPk(org.objectstyle.cayenne.access.DataNode node, java.util.List dbEntities)
          Drops any common database objects associated with automatic primary key generation process.
 java.util.List dropAutoPkStatements(java.util.List dbEntities)
          Returns SQL string needed to drop database objects associated with automatic primary key generation.
 java.lang.Object generatePkForDbEntity(org.objectstyle.cayenne.access.DataNode dataNode, org.objectstyle.cayenne.map.DbEntity ent)
          Generates new (unique and non-repeating) primary key for specified DbEntity.
 java.lang.String generatePkForDbEntityString(org.objectstyle.cayenne.map.DbEntity ent)
          Returns SQL string that can generate new (unique and non-repeating) primary key for specified DbEntity.
 void reset()
           
 

Method Detail

createAutoPk

public void createAutoPk(org.objectstyle.cayenne.access.DataNode node,
                         java.util.List dbEntities)
                  throws java.lang.Exception
Generates necessary database objects to provide automatic primary key support.


createAutoPkStatements

public java.util.List createAutoPkStatements(java.util.List dbEntities)
Returns a list of SQL strings needed to generates database objects to provide automatic primary support for the list of entities. No actual database operations are performed.


dropAutoPk

public void dropAutoPk(org.objectstyle.cayenne.access.DataNode node,
                       java.util.List dbEntities)
                throws java.lang.Exception
Drops any common database objects associated with automatic primary key generation process. This may be lookup tables, special stored procedures or sequences.


dropAutoPkStatements

public java.util.List dropAutoPkStatements(java.util.List dbEntities)
Returns SQL string needed to drop database objects associated with automatic primary key generation. No actual database operations are performed.


generatePkForDbEntity

public java.lang.Object generatePkForDbEntity(org.objectstyle.cayenne.access.DataNode dataNode,
                                              org.objectstyle.cayenne.map.DbEntity ent)
                                       throws java.lang.Exception
Generates new (unique and non-repeating) primary key for specified DbEntity.


generatePkForDbEntityString

public java.lang.String generatePkForDbEntityString(org.objectstyle.cayenne.map.DbEntity ent)
Returns SQL string that can generate new (unique and non-repeating) primary key for specified DbEntity. No actual database operations are performed.


reset

public void reset()