Examples of TypeDef


Examples of org.hibernate.mapping.TypeDef

            paramElement.getTextTrim()
          );
      }
    }

    TypeDef typeDef = mappings.getTypeDef( typeName );
    if ( typeDef != null ) {
      typeName = typeDef.getTypeClass();
      // parameters on the property mapping should
      // override parameters in the typedef
      Properties allParameters = new Properties();
      allParameters.putAll( typeDef.getParameters() );
      allParameters.putAll( parameters );
      parameters = allParameters;
    }

    if ( !parameters.isEmpty() ) simpleValue.setTypeParameters( parameters );
View Full Code Here

Examples of org.hibernate.mapping.TypeDef

    }

    Attribute typeNode = node.attribute( "collection-type" );
    if ( typeNode != null ) {
      String typeName = typeNode.getValue();
      TypeDef typeDef = mappings.getTypeDef( typeName );
      if ( typeDef != null ) {
        collection.setTypeName( typeDef.getTypeClass() );
        collection.setTypeParameters( typeDef.getParameters() );
      }
      else {
        collection.setTypeName( typeName );
      }
    }
View Full Code Here

Examples of org.hibernate.mapping.TypeDef

    public TypeDef getTypeDef(String typeName) {
      return typeDefs.get( typeName );
    }

    public void addTypeDef(String typeName, String typeClass, Properties paramMap) {
      TypeDef def = new TypeDef( typeClass, paramMap );
      typeDefs.put( typeName, def );
      log.debug( "Added " + typeName + " with class " + typeClass );
    }
View Full Code Here

Examples of org.hibernate.mapping.TypeDef

    resolveAndBindTypeDef(simpleValue, mappings, typeName, parameters);
  }

  private static void resolveAndBindTypeDef(SimpleValue simpleValue,
      Mappings mappings, String typeName, Properties parameters) {
    TypeDef typeDef = mappings.getTypeDef( typeName );
    if ( typeDef != null ) {
      typeName = typeDef.getTypeClass();
      // parameters on the property mapping should
      // override parameters in the typedef
      Properties allParameters = new Properties();
      allParameters.putAll( typeDef.getParameters() );
      allParameters.putAll( parameters );
      parameters = allParameters;
    }else if (typeName!=null && !mappings.isInSecondPass()){
      BasicType basicType=mappings.getTypeResolver().basic(typeName);
      if (basicType==null) {
View Full Code Here

Examples of org.hibernate.mapping.TypeDef

    }

    Attribute typeNode = node.attribute( "collection-type" );
    if ( typeNode != null ) {
      String typeName = typeNode.getValue();
      TypeDef typeDef = mappings.getTypeDef( typeName );
      if ( typeDef != null ) {
        collection.setTypeName( typeDef.getTypeClass() );
        collection.setTypeParameters( typeDef.getParameters() );
      }
      else {
        collection.setTypeName( typeName );
      }
    }
View Full Code Here

Examples of org.hibernate.mapping.TypeDef

    final CollectionType typeAnnotation = property.getAnnotation( CollectionType.class );
    if ( typeAnnotation != null ) {
      final String typeName = typeAnnotation.type();
      // see if it names a type-def
      final TypeDef typeDef = mappings.getTypeDef( typeName );
      if ( typeDef != null ) {
        result.explicitType = typeDef.getTypeClass();
        result.explicitTypeParameters.putAll( typeDef.getParameters() );
      }
      else {
        result.explicitType = typeName;
        for ( Parameter param : typeAnnotation.parameters() ) {
          result.explicitTypeParameters.setProperty( param.name(), param.value() );
View Full Code Here

Examples of org.hibernate.mapping.TypeDef

      );
    }

    // set explicit type information
    if ( explicitType != null ) {
      final TypeDef typeDef = mappings.getTypeDef( explicitType );
      if ( typeDef == null ) {
        collection.setTypeName( explicitType );
        collection.setTypeParameters( explicitTypeParameters );
      }
      else {
        collection.setTypeName( typeDef.getTypeClass() );
        collection.setTypeParameters( typeDef.getParameters() );
      }
    }

    //set laziness
    defineFetchingStrategy();
View Full Code Here

Examples of org.hibernate.mapping.TypeDef

            paramElement.getTextTrim()
          );
      }
    }

    TypeDef typeDef = mappings.getTypeDef( typeName );
    if ( typeDef != null ) {
      typeName = typeDef.getTypeClass();
      // parameters on the property mapping should
      // override parameters in the typedef
      Properties allParameters = new Properties();
      allParameters.putAll( typeDef.getParameters() );
      allParameters.putAll( parameters );
      parameters = allParameters;
    }

    if ( !parameters.isEmpty() ) simpleValue.setTypeParameters( parameters );
View Full Code Here

Examples of org.hibernate.metamodel.binding.TypeDef

      throw new IllegalArgumentException( "Type definition is null" );
    }
    else if ( typeDef.getName() == null ) {
      throw new IllegalArgumentException( "Type definition name is null: " + typeDef.getTypeClass() );
    }
    final TypeDef previous = typeDefs.put( typeDef.getName(), typeDef );
    if ( previous != null ) {
      LOG.debugf( "Duplicate typedef name [%s] now -> %s", typeDef.getName(), typeDef.getTypeClass() );
    }
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.TypeDef

      final Map<String, String> parameters = new HashMap<String, String>();
      for ( JaxbParamElement paramElement : typedef.getParam() ) {
        parameters.put( paramElement.getName(), paramElement.getValue() );
      }
      metadata.addTypeDefinition(
          new TypeDef(
              typedef.getName(),
              typedef.getClazz(),
              parameters
          )
      );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.