KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > h2 > engine > UserDataType


1 /*
2  * Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
3  * Initial Developer: H2 Group
4  */

5 package org.h2.engine;
6
7 import java.sql.SQLException JavaDoc;
8
9 import org.h2.message.Message;
10 import org.h2.message.Trace;
11 import org.h2.table.Column;
12 import org.h2.table.Table;
13
14 public class UserDataType extends DbObject {
15     
16     private Column column;
17
18     public UserDataType(Database database, int id, String JavaDoc name) {
19         super(database, id, name, Trace.DATABASE);
20     }
21
22     public String JavaDoc getCreateSQLForCopy(Table table, String JavaDoc quotedName) {
23         throw Message.getInternalError();
24     }
25
26     public String JavaDoc getCreateSQL() {
27         StringBuffer JavaDoc buff = new StringBuffer JavaDoc();
28         buff.append("CREATE DOMAIN ");
29         buff.append(getSQL());
30         buff.append(" AS ");
31         buff.append(column.getCreateSQL());
32         return buff.toString();
33     }
34     
35     public Column getColumn() {
36         return column;
37     }
38
39     public int getType() {
40         return DbObject.USER_DATATYPE;
41     }
42
43     public void removeChildrenAndResources(Session session) throws SQLException JavaDoc {
44     }
45
46     public void checkRename() throws SQLException JavaDoc {
47     }
48
49     public void setColumn(Column column) {
50         this.column = column;
51     }
52     
53 }
54
Popular Tags