KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > id > PersistentIdentifierGenerator


1 //$Id: PersistentIdentifierGenerator.java,v 1.5 2005/04/26 06:37:53 oneovthafew Exp $
2
package org.hibernate.id;
3
4 import org.apache.commons.logging.Log;
5 import org.apache.commons.logging.LogFactory;
6 import org.hibernate.HibernateException;
7 import org.hibernate.dialect.Dialect;
8
9 /**
10  * An <tt>IdentifierGenerator</tt> that requires creation of database objects.
11  * <br><br>
12  * All <tt>PersistentIdentifierGenerator</tt>s that also implement
13  * <tt>Configurable</tt> have access to a special mapping parameter: schema
14  *
15  * @see IdentifierGenerator
16  * @see Configurable
17  * @author Gavin King
18  */

19 public interface PersistentIdentifierGenerator extends IdentifierGenerator {
20
21     /**
22      * The configuration parameter holding the schema name
23      */

24     public static final String JavaDoc SCHEMA = "schema";
25
26     /**
27      * The configuration parameter holding the table name for the
28      * generated id
29      */

30     public static final String JavaDoc TABLE = "target_table";
31
32     /**
33      * The configuration parameter holding the table names for all
34      * tables for which the id must be unique
35      */

36     public static final String JavaDoc TABLES = "identity_tables";
37
38     /**
39      * The configuration parameter holding the primary key column
40      * name of the generated id
41      */

42     public static final String JavaDoc PK = "target_column";
43
44     /**
45      * The configuration parameter holding the catalog name
46      */

47     public static final String JavaDoc CATALOG = "catalog";
48     
49     /**
50      * The SQL required to create the underlying database objects.
51      * @param dialect
52      * @return String[]
53      * @throws HibernateException
54      */

55     public String JavaDoc[] sqlCreateStrings(Dialect dialect) throws HibernateException;
56
57     /**
58      * The SQL required to remove the underlying database objects.
59      * @param dialect
60      * @return String
61      * @throws HibernateException
62      */

63     public String JavaDoc[] sqlDropStrings(Dialect dialect) throws HibernateException;
64
65     /**
66      * Return a key unique to the underlying database objects. Prevents us from
67      * trying to create/remove them multiple times.
68      * @return Object an identifying key for this generator
69      */

70     public Object JavaDoc generatorKey();
71     
72     static final Log SQL = LogFactory.getLog("org.hibernate.SQL");
73
74 }
75
76
77
78
79
80
81
Popular Tags