KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: DependantValue.java,v 1.8 2005/02/12 07:19:26 steveebersole Exp $
2
package org.hibernate.mapping;
3
4 import org.hibernate.MappingException;
5 import org.hibernate.type.Type;
6
7 /**
8  * A value which is "typed" by reference to some other
9  * value (for example, a foreign key is typed by the
10  * referenced primary key).
11  *
12  * @author Gavin King
13  */

14 public class DependantValue extends SimpleValue {
15     private KeyValue wrappedValue;
16     private boolean nullable;
17     private boolean updateable;
18
19     public DependantValue(Table table, KeyValue prototype) {
20         super(table);
21         this.wrappedValue = prototype;
22     }
23
24     public Type getType() throws MappingException {
25         return wrappedValue.getType();
26     }
27
28     public void setTypeUsingReflection(String JavaDoc className, String JavaDoc propertyName) {}
29     
30     public Object JavaDoc accept(ValueVisitor visitor) {
31         return visitor.accept(this);
32     }
33
34     public boolean isNullable() {
35         return nullable;
36     
37     }
38     
39     public void setNullable(boolean nullable) {
40         this.nullable = nullable;
41     }
42     
43     public boolean isUpdateable() {
44         return updateable;
45     }
46     
47     public void setUpdateable(boolean updateable) {
48         this.updateable = updateable;
49     }
50 }
51
Popular Tags