01: //$Id: PersistentIdentifierGenerator.java 6514 2005-04-26 06:37:54Z oneovthafew $
02: package org.hibernate.id;
03:
04: import org.apache.commons.logging.Log;
05: import org.apache.commons.logging.LogFactory;
06: import org.hibernate.HibernateException;
07: import org.hibernate.dialect.Dialect;
08:
09: /**
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
20: IdentifierGenerator {
21:
22: /**
23: * The configuration parameter holding the schema name
24: */
25: public static final String SCHEMA = "schema";
26:
27: /**
28: * The configuration parameter holding the table name for the
29: * generated id
30: */
31: public static final String TABLE = "target_table";
32:
33: /**
34: * The configuration parameter holding the table names for all
35: * tables for which the id must be unique
36: */
37: public static final String TABLES = "identity_tables";
38:
39: /**
40: * The configuration parameter holding the primary key column
41: * name of the generated id
42: */
43: public static final String PK = "target_column";
44:
45: /**
46: * The configuration parameter holding the catalog name
47: */
48: public static final String CATALOG = "catalog";
49:
50: /**
51: * The SQL required to create the underlying database objects.
52: * @param dialect
53: * @return String[]
54: * @throws HibernateException
55: */
56: public String[] sqlCreateStrings(Dialect dialect)
57: throws HibernateException;
58:
59: /**
60: * The SQL required to remove the underlying database objects.
61: * @param dialect
62: * @return String
63: * @throws HibernateException
64: */
65: public String[] sqlDropStrings(Dialect dialect)
66: throws HibernateException;
67:
68: /**
69: * Return a key unique to the underlying database objects. Prevents us from
70: * trying to create/remove them multiple times.
71: * @return Object an identifying key for this generator
72: */
73: public Object generatorKey();
74:
75: static final Log SQL = LogFactory.getLog("org.hibernate.SQL");
76:
77: }
|