Search in sources :

Example 1 with Size

use of org.hibernate.engine.jdbc.Size in project hibernate-orm by hibernate.

the class CompositeCustomType method defaultSizes.

@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
    //Not called at runtime so doesn't matter if its slow :)
    final Size[] sizes = new Size[getColumnSpan(mapping)];
    int soFar = 0;
    for (Type propertyType : userType.getPropertyTypes()) {
        final Size[] propertySizes = propertyType.defaultSizes(mapping);
        System.arraycopy(propertySizes, 0, sizes, soFar, propertySizes.length);
        soFar += propertySizes.length;
    }
    return sizes;
}
Also used : CompositeUserType(org.hibernate.usertype.CompositeUserType) LoggableUserType(org.hibernate.usertype.LoggableUserType) Size(org.hibernate.engine.jdbc.Size)

Example 2 with Size

use of org.hibernate.engine.jdbc.Size in project hibernate-orm by hibernate.

the class CompositeCustomType method dictatedSizes.

@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
    //Not called at runtime so doesn't matter if its slow :)
    final Size[] sizes = new Size[getColumnSpan(mapping)];
    int soFar = 0;
    for (Type propertyType : userType.getPropertyTypes()) {
        final Size[] propertySizes = propertyType.dictatedSizes(mapping);
        System.arraycopy(propertySizes, 0, sizes, soFar, propertySizes.length);
        soFar += propertySizes.length;
    }
    return sizes;
}
Also used : CompositeUserType(org.hibernate.usertype.CompositeUserType) LoggableUserType(org.hibernate.usertype.LoggableUserType) Size(org.hibernate.engine.jdbc.Size)

Aggregations

Size (org.hibernate.engine.jdbc.Size)2 CompositeUserType (org.hibernate.usertype.CompositeUserType)2 LoggableUserType (org.hibernate.usertype.LoggableUserType)2