下面列出了怎么用org.hibernate.engine.jdbc.Size的API类实例代码及写法,或者点击链接到github查看源代码。
@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 : propertyTypes ) {
final Size[] propertySizes = propertyType.dictatedSizes( mapping );
System.arraycopy( propertySizes, 0, sizes, soFar, propertySizes.length );
soFar += propertySizes.length;
}
return sizes;
}
@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 : propertyTypes ) {
final Size[] propertySizes = propertyType.defaultSizes( mapping );
System.arraycopy( propertySizes, 0, sizes, soFar, propertySizes.length );
soFar += propertySizes.length;
}
return sizes;
}
public CustomType(UserType userType, String[] registrationKeys) throws MappingException {
this.userType = userType;
this.name = userType.getClass().getName();
this.types = userType.sqlTypes();
this.dictatedSizes = Sized.class.isInstance( userType )
? ( (Sized) userType ).dictatedSizes()
: new Size[ types.length ];
this.defaultSizes = Sized.class.isInstance( userType )
? ( (Sized) userType ).defaultSizes()
: new Size[ types.length ];
this.customLogging = LoggableUserType.class.isInstance( userType );
this.registrationKeys = registrationKeys;
}
@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;
}
@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;
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return underlyingType.dictatedSizes( mapping );
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return underlyingType.defaultSizes( mapping );
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return super.getIdentifierOrUniqueKeyType( mapping ).dictatedSizes( mapping );
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return super.getIdentifierOrUniqueKeyType( mapping ).defaultSizes( mapping );
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return dictatedSizes;
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return defaultSizes;
}
protected static Size getDefaultSize() {
return DEFAULT_SIZE;
}
protected Size getDictatedSize() {
return dictatedSize;
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return new Size[] { getDictatedSize() };
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return new Size[] { getDefaultSize() };
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return requireIdentifierOrUniqueKeyType( mapping ).dictatedSizes( mapping );
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return requireIdentifierOrUniqueKeyType( mapping ).defaultSizes( mapping );
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return SIZES;
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return SIZES;
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return ArrayHelper.join( discriminatorType.dictatedSizes( mapping ), identifierType.dictatedSizes( mapping ) );
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return ArrayHelper.join( discriminatorType.defaultSizes( mapping ), identifierType.defaultSizes( mapping ) );
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return new Size[] { LEGACY_DICTATED_SIZE };
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return new Size[] { LEGACY_DEFAULT_SIZE };
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return baseType.dictatedSizes( mapping );
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return baseType.defaultSizes( mapping );
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return new Size[]{new Size()};
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return dictatedSizes(mapping);
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return new Size[]{new Size()};
}
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
return dictatedSizes(mapping);
}
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
return columnMapper.getHibernateType().dictatedSizes(mapping);
}