Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type
In directory sc8-pr-cvs1:/tmp/cvs-serv11660/sf/hibernate/type
Modified Files:
CompositeCustomType.java ObjectType.java
Log Message:
* imporvements to CompositeUserType
* cascades for <any> mappings
* fixed some bugs withy collection Filter parameters
* correct Type for avg(int)
Index: CompositeCustomType.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/CompositeCustomType.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CompositeCustomType.java 6 Apr 2003 10:11:12 -0000 1.2
--- CompositeCustomType.java 8 Apr 2003 09:49:34 -0000 1.3
***************
*** 113,117 ****
public int getColumnSpan(Mapping mapping) throws MappingException {
! return userType.sqlTypes().length;
}
--- 113,122 ----
public int getColumnSpan(Mapping mapping) throws MappingException {
! Type[] types = userType.getPropertyTypes();
! int n=0;
! for (int i=0; i<types.length; i++) {
! n+=types[i].getColumnSpan(mapping);
! }
! return n;
}
***************
*** 164,168 ****
public int[] sqlTypes(Mapping mapping) throws MappingException {
! return userType.sqlTypes();
}
--- 169,180 ----
public int[] sqlTypes(Mapping mapping) throws MappingException {
! Type[] types = userType.getPropertyTypes();
! int[] result = new int[ getColumnSpan(mapping) ];
! int n=0;
! for (int i=0; i<types.length; i++) {
! int[] sqlTypes = types[i].sqlTypes(mapping);
! for ( int k=0; k<sqlTypes.length; k++ ) result[n++] = sqlTypes[k];
! }
! return result;
}
Index: ObjectType.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/type/ObjectType.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ObjectType.java 6 Apr 2003 10:11:13 -0000 1.8
--- ObjectType.java 8 Apr 2003 09:49:35 -0000 1.9
***************
*** 19,23 ****
import net.sf.hibernate.util.ArrayHelper;
! public class ObjectType extends AbstractType implements AbstractComponentType {
private Type identifierType;
--- 19,23 ----
import net.sf.hibernate.util.ArrayHelper;
! public class ObjectType extends AbstractType implements AbstractComponentType, AssociationType {
private Type identifierType;
***************
*** 241,244 ****
--- 241,253 ----
public boolean isComponentType() {
+ return true;
+ }
+
+ public ForeignKeyType getForeignKeyType() {
+ //return AssociationType.FOREIGN_KEY_TO_PARENT; //TODO: this is better but causes a transient object exception...
+ return AssociationType.FOREIGN_KEY_FROM_PARENT;
+ }
+
+ public boolean isAssociationType() {
return true;
}
|