@@ -63,83 +63,3 @@ public virtual bool IsNullable {
63
63
64
64
}
65
65
}
66
-
67
- /*
68
- //$Id$
69
- package net.sf.hibernate.type;
70
-
71
- import java.io.Serializable;
72
- import java.sql.PreparedStatement;
73
- import java.sql.ResultSet;
74
- import java.sql.SQLException;
75
-
76
- import net.sf.hibernate.HibernateException;
77
- import net.sf.hibernate.MappingException;
78
- import net.sf.hibernate.engine.Mapping;
79
- import net.sf.hibernate.engine.SessionImplementor;
80
-
81
-
82
-
83
- public class OneToOneType extends EntityType implements AssociationType {
84
-
85
- private static final int[] NO_INTS = new int[0];
86
- private final AssociationType.ForeignKeyType foreignKeyType;
87
-
88
- public int getColumnSpan(Mapping session) throws MappingException {
89
- return 0;
90
- }
91
-
92
-
93
- public int[] sqlTypes(Mapping session) throws MappingException {
94
- return NO_INTS;
95
- }
96
-
97
- public OneToOneType(Class persistentClass, AssociationType.ForeignKeyType foreignKeyType) {
98
- super(persistentClass);
99
- this.foreignKeyType = foreignKeyType;
100
- }
101
-
102
- public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException {
103
- //nothing to do
104
- }
105
-
106
- public boolean isOneToOne() {
107
- return true;
108
- }
109
-
110
-
111
- public boolean isDirty(Object old, Object current, SessionImplementor session) throws HibernateException {
112
- return false;
113
- }
114
-
115
- public AssociationType.ForeignKeyType getForeignKeyType() {
116
- return foreignKeyType;
117
- }
118
-
119
- public Object hydrate(
120
- ResultSet rs,
121
- String[] names,
122
- SessionImplementor session,
123
- Object owner
124
- ) throws HibernateException, SQLException {
125
-
126
- return session.getEntityIdentifier(owner);
127
- }
128
-
129
- public Object resolveIdentifier(Object value, SessionImplementor session, Object owner) throws HibernateException, SQLException {
130
-
131
- if (value==null) return null;
132
-
133
- Class clazz = getPersistentClass();
134
- Serializable id = (Serializable) value;
135
-
136
- return isNullable() ?
137
- session.internalLoadOneToOne(clazz, id) :
138
- session.internalLoad(clazz, id);
139
- }
140
-
141
- public boolean isNullable() {
142
- return foreignKeyType==AssociationType.FOREIGN_KEY_TO_PARENT;
143
- }
144
-
145
- }*/
0 commit comments