Java Code Examples for org.hibernate.engine.jdbc.Size

The following examples show how to use org.hibernate.engine.jdbc.Size. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: lams   Source File: ComponentType.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 2
Source Project: lams   Source File: ComponentType.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 3
Source Project: lams   Source File: CustomType.java    License: GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 4
Source Project: lams   Source File: CompositeCustomType.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 5
Source Project: lams   Source File: CompositeCustomType.java    License: GNU General Public License v2.0 5 votes vote down vote up
@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;
}
 
Example 6
Source Project: lams   Source File: DiscriminatorType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return underlyingType.dictatedSizes( mapping );
}
 
Example 7
Source Project: lams   Source File: DiscriminatorType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return underlyingType.defaultSizes( mapping );
}
 
Example 8
Source Project: lams   Source File: SpecialOneToOneType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return super.getIdentifierOrUniqueKeyType( mapping ).dictatedSizes( mapping );
}
 
Example 9
Source Project: lams   Source File: SpecialOneToOneType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return super.getIdentifierOrUniqueKeyType( mapping ).defaultSizes( mapping );
}
 
Example 10
Source Project: lams   Source File: CustomType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return dictatedSizes;
}
 
Example 11
Source Project: lams   Source File: CustomType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return defaultSizes;
}
 
Example 12
protected static Size getDefaultSize() {
	return DEFAULT_SIZE;
}
 
Example 13
protected Size getDictatedSize() {
	return dictatedSize;
}
 
Example 14
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return new Size[] { getDictatedSize() };
}
 
Example 15
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return new Size[] { getDefaultSize() };
}
 
Example 16
Source Project: lams   Source File: ManyToOneType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return requireIdentifierOrUniqueKeyType( mapping ).dictatedSizes( mapping );
}
 
Example 17
Source Project: lams   Source File: ManyToOneType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return requireIdentifierOrUniqueKeyType( mapping ).defaultSizes( mapping );
}
 
Example 18
Source Project: lams   Source File: OneToOneType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return SIZES;
}
 
Example 19
Source Project: lams   Source File: OneToOneType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return SIZES;
}
 
Example 20
Source Project: lams   Source File: AnyType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return ArrayHelper.join( discriminatorType.dictatedSizes( mapping ), identifierType.dictatedSizes( mapping ) );
}
 
Example 21
Source Project: lams   Source File: AnyType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return ArrayHelper.join( discriminatorType.defaultSizes( mapping ), identifierType.defaultSizes( mapping ) );
}
 
Example 22
Source Project: lams   Source File: CollectionType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return new Size[] { LEGACY_DICTATED_SIZE };
}
 
Example 23
Source Project: lams   Source File: CollectionType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return new Size[] { LEGACY_DEFAULT_SIZE };
}
 
Example 24
Source Project: lams   Source File: MetaType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return baseType.dictatedSizes( mapping );
}
 
Example 25
Source Project: lams   Source File: MetaType.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
	return baseType.defaultSizes( mapping );
}
 
Example 26
Source Project: hibernate-types   Source File: ImmutableType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
    return new Size[]{new Size()};
}
 
Example 27
Source Project: hibernate-types   Source File: ImmutableType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
    return dictatedSizes(mapping);
}
 
Example 28
Source Project: hibernate-types   Source File: ImmutableType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
    return new Size[]{new Size()};
}
 
Example 29
Source Project: hibernate-types   Source File: ImmutableType.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Size[] defaultSizes(Mapping mapping) throws MappingException {
    return dictatedSizes(mapping);
}
 
Example 30
@Override
public Size[] dictatedSizes(Mapping mapping) throws MappingException {
	return columnMapper.getHibernateType().dictatedSizes(mapping);
}