KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > mapper > rdb > lib > RdbColumnInfo


1 /**
2  * Speedo: an implementation of JDO compliant personality on top of JORM generic
3  * I/O sub-system.
4  * Copyright (C) 2001-2004 France Telecom R&D
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  *
21  *
22  * Contact: speedo@objectweb.org
23  *
24  */

25
26 package org.objectweb.jorm.mapper.rdb.lib;
27
28 /**
29  * This class is used to describe a mapping for the inheritance.
30  * It describes a primitive element mapped onto a sql column.
31  * @author Y.Bersihand
32  */

33 public class RdbColumnInfo implements Comparable JavaDoc{
34
35     //the sql name of the field
36
private String JavaDoc name;
37     //the java name of the field
38
private String JavaDoc alias;
39     //the jorm class to which it belongs
40
private String JavaDoc className;
41     
42     public RdbColumnInfo(String JavaDoc name, String JavaDoc alias, String JavaDoc className){
43         this.name = name;
44         this.alias = alias;
45         this.className = className;
46     }
47     
48     public void setAlias(String JavaDoc alias) {
49         this.alias = alias;
50     }
51     public void setClassName(String JavaDoc className) {
52         this.className = className;
53     }
54     public void setName(String JavaDoc name) {
55         this.name = name;
56     }
57     
58     public String JavaDoc getAlias() {
59         return alias;
60     }
61     public String JavaDoc getClassName() {
62         return className;
63     }
64     public String JavaDoc getName() {
65         return name;
66     }
67     
68     public int compareTo(Object JavaDoc o) {
69         if (o instanceof RdbColumnInfo) {
70             RdbColumnInfo c = (RdbColumnInfo) o;
71             return this.alias.compareTo(c.getAlias());
72         }
73         return -1;
74     }
75 }
76
Popular Tags