KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > mapping > IdGenerator


1 //$Id: IdGenerator.java,v 1.2 2005/01/18 01:00:26 epbernard Exp $
2
package org.hibernate.mapping;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.Properties JavaDoc;
6
7 /**
8  * Identifier generator container,
9  * Useful to keep named generator in annotations
10  *
11  * @author Emmanuel Bernard
12  */

13 public class IdGenerator implements Serializable JavaDoc {
14     private String JavaDoc name;
15     private String JavaDoc identifierGeneratorStrategy;
16     private Properties JavaDoc params = new Properties JavaDoc();
17     
18     
19
20     /**
21      * @return identifier generator strategy
22      */

23     public String JavaDoc getIdentifierGeneratorStrategy() {
24         return identifierGeneratorStrategy;
25     }
26
27     /**
28      * @return generator name
29      */

30     public String JavaDoc getName() {
31         return name;
32     }
33
34     /**
35      * @return generator configuration parameters
36      */

37     public Properties JavaDoc getParams() {
38         return params;
39     }
40
41     public void setIdentifierGeneratorStrategy(String JavaDoc string) {
42         identifierGeneratorStrategy = string;
43     }
44
45     public void setName(String JavaDoc string) {
46         name = string;
47     }
48
49     public void addParam(String JavaDoc key, String JavaDoc value) {
50         params.setProperty(key, value);
51     }
52
53 }
54
Popular Tags