/** * @deprecated Use {@link #manyToOne(String, boolean, String, boolean, boolean, boolean, boolean)} instead. */ @Deprecated public EntityType manyToOne( String persistentClass, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean ignoreNotFound, boolean isLogicalOneToOne) { return manyToOne( persistentClass, uniqueKeyPropertyName == null, uniqueKeyPropertyName, lazy, unwrapProxy, ignoreNotFound, isLogicalOneToOne ); }
@Override public CollectionType getDefaultCollectionType() throws MappingException { return getMetadata().getTypeResolver() .getTypeFactory() .array( getRole(), getReferencedPropertyName(), getElementClass() ); }
public CollectionType getDefaultCollectionType() { return getMetadata().getTypeResolver() .getTypeFactory() .bag( getRole(), getReferencedPropertyName() ); }
/** * @deprecated Use {@link TypeConfiguration}/{@link TypeConfiguration.Scope} instead */ @Deprecated public interface TypeScope extends Serializable { TypeConfiguration getTypeConfiguration(); }
public Type byClass(Class clazz, Properties parameters) { if ( Type.class.isAssignableFrom( clazz ) ) { return type( clazz, parameters ); } if ( CompositeUserType.class.isAssignableFrom( clazz ) ) { return customComponent( clazz, parameters ); } if ( UserType.class.isAssignableFrom( clazz ) ) { return custom( clazz, parameters ); } if ( Lifecycle.class.isAssignableFrom( clazz ) ) { // not really a many-to-one association *necessarily* return manyToOne( clazz.getName() ); } if ( Serializable.class.isAssignableFrom( clazz ) ) { return serializable( clazz ); } return null; }
public CollectionType getDefaultCollectionType() { if ( isSorted() ) { return getMetadata().getTypeResolver() .getTypeFactory() .sortedMap( getRole(), getReferencedPropertyName(), getComparator() ); } else if ( hasOrder() ) { return getMetadata().getTypeResolver() .getTypeFactory() .orderedMap( getRole(), getReferencedPropertyName() ); } else { return getMetadata().getTypeResolver() .getTypeFactory() .map( getRole(), getReferencedPropertyName() ); } }
public CollectionType getDefaultCollectionType() { if ( isSorted() ) { return getMetadata().getTypeResolver() .getTypeFactory() .sortedSet( getRole(), getReferencedPropertyName(), getComparator() ); } else if ( hasOrder() ) { return getMetadata().getTypeResolver() .getTypeFactory() .orderedSet( getRole(), getReferencedPropertyName() ); } else { return getMetadata().getTypeResolver() .getTypeFactory() .set( getRole(), getReferencedPropertyName() ); } }
Type type = TypeFactory.basic( typeName ); if ( type == null ) { Class typeClass; injectParameters(type, parameters);
public void setParameterValues( Properties parameters ) { String enumClassName = parameters.getProperty( "enumClass" ); try { enumClass = Class.forName( enumClassName ).asSubclass( Enum.class ); } catch ( ClassNotFoundException cfne ) { throw new HibernateException( "Enum class not found", cfne ); } String identifierMethodName = parameters.getProperty( "identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME ); try { identifierMethod = enumClass.getMethod( identifierMethodName, new Class[0] ); identifierType = identifierMethod.getReturnType(); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain identifier method", e ); } type = ( NullableType ) TypeFactory.basic( identifierType.getName() ); if ( type == null ) throw new HibernateException( "Unsupported identifier type " + identifierType.getName() ); sqlTypes = new int[]{type.sqlType()}; String valueOfMethodName = parameters.getProperty( "valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME ); try { valueOfMethod = enumClass.getMethod( valueOfMethodName, new Class[]{identifierType} ); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain valueOf method", e ); } }
private Type determineDefaultCollectionInformation(AbstractPluralAttributeBinding attributeBinding) { final TypeFactory typeFactory = metadata.getTypeResolver().getTypeFactory(); switch ( attributeBinding.getAttribute().getNature() ) { case SET: { return typeFactory.set( attributeBinding.getAttribute().getName(), attributeBinding.getReferencedPropertyName(), attributeBinding.getCollectionElement().getCollectionElementNature() == CollectionElementNature.COMPOSITE ); } case BAG: { return typeFactory.bag( attributeBinding.getAttribute().getName(), attributeBinding.getReferencedPropertyName(), attributeBinding.getCollectionElement() .getCollectionElementNature() == CollectionElementNature.COMPOSITE ); } default: { throw new UnsupportedOperationException( "Collection type not supported yet:" + attributeBinding.getAttribute().getNature() ); } } }
public CollectionType getCollectionType() { if ( typeName == null ) { return getDefaultCollectionType(); } else { return getMetadata().getTypeConfiguration().getTypeResolver() .getTypeFactory() .customCollection( typeName, typeParameters, role, referencedPropertyName ); } }
public CollectionType getDefaultCollectionType() throws MappingException { return getMetadata().getTypeResolver() .getTypeFactory() .list( getRole(), getReferencedPropertyName() ); }
public CollectionType getDefaultCollectionType() { return getMetadata().getTypeResolver() .getTypeFactory() .idbag( getRole(), getReferencedPropertyName() ); }
public Type getType() throws MappingException { if ( getColumnIterator().hasNext() ) { return new SpecialOneToOneType( getReferencedEntityName(), foreignKeyType, referencedPropertyName, isLazy(), entityName, propertyName ); } else { return TypeFactory.oneToOne( getReferencedEntityName(), foreignKeyType, referencedPropertyName, isLazy(), isEmbedded(), entityName, propertyName ); } }
public Type byClass(Class clazz, Properties parameters) { if ( Type.class.isAssignableFrom( clazz ) ) { return type( clazz, parameters ); } if ( CompositeUserType.class.isAssignableFrom( clazz ) ) { return customComponent( clazz, parameters ); } if ( UserType.class.isAssignableFrom( clazz ) ) { return custom( clazz, parameters ); } if ( Lifecycle.class.isAssignableFrom( clazz ) ) { // not really a many-to-one association *necessarily* return manyToOne( clazz.getName() ); } if ( Serializable.class.isAssignableFrom( clazz ) ) { return serializable( clazz ); } return null; }
public CollectionType getDefaultCollectionType() { if ( isSorted() ) { return TypeFactory.sortedMap( getRole(), getReferencedPropertyName(), isEmbedded(), getComparator() ); } else if ( hasOrder() ) { return TypeFactory.orderedMap( getRole(), getReferencedPropertyName(), isEmbedded() ); } else { return TypeFactory.map( getRole(), getReferencedPropertyName(), isEmbedded() ); } }
public CollectionType getDefaultCollectionType() { if ( isSorted() ) { return TypeFactory.sortedSet( getRole(), getReferencedPropertyName(), isEmbedded(), getComparator() ); } else if ( hasOrder() ) { return TypeFactory.orderedSet( getRole(), getReferencedPropertyName(), isEmbedded() ); } else { return TypeFactory.set( getRole(), getReferencedPropertyName(), isEmbedded() ); } }
@Override public void setParameterValues( Properties parameters ) { String enumClassName = parameters.getProperty( "enumClass" ); try { enumClass = Class.forName( enumClassName ).asSubclass( Enum.class ); } catch ( ClassNotFoundException cfne ) { throw new HibernateException( "Enum class not found", cfne ); } String identifierMethodName = parameters.getProperty( "identifierMethod", DEFAULT_IDENTIFIER_METHOD_NAME ); try { identifierMethod = enumClass.getMethod( identifierMethodName, new Class[0] ); identifierType = identifierMethod.getReturnType(); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain identifier method", e ); } type = ( NullableType ) TypeFactory.basic( identifierType.getName() ); if ( type == null ) throw new HibernateException( "Unsupported identifier type " + identifierType.getName() ); sqlTypes = new int[]{type.sqlType()}; String valueOfMethodName = parameters.getProperty( "valueOfMethod", DEFAULT_VALUE_OF_METHOD_NAME ); try { valueOfMethod = enumClass.getMethod( valueOfMethodName, new Class[]{identifierType} ); } catch ( Exception e ) { throw new HibernateException( "Failed to obtain valueOf method", e ); } }