Package org.hibernate.annotations

Examples of org.hibernate.annotations.GenericGenerator


  private static HashMap<String, IdGenerator> buildLocalGenerators(XAnnotatedElement annElt, Mappings mappings) {
    HashMap<String, IdGenerator> generators = new HashMap<String, IdGenerator>();
    TableGenerator tabGen = annElt.getAnnotation( TableGenerator.class );
    SequenceGenerator seqGen = annElt.getAnnotation( SequenceGenerator.class );
    GenericGenerator genGen = annElt.getAnnotation( GenericGenerator.class );
    if ( tabGen != null ) {
      IdGenerator idGen = buildIdGenerator( tabGen, mappings );
      generators.put( idGen.getName(), idGen );
    }
    if ( seqGen != null ) {
View Full Code Here


    bindTypeDefs( pckg, mappings );
    BinderHelper.bindAnyMetaDefs( pckg, mappings );
  }

  private static void bindGenericGenerators(XAnnotatedElement annotatedElement, ExtendedMappings mappings) {
    GenericGenerator defAnn = annotatedElement.getAnnotation( GenericGenerator.class );
    GenericGenerators defsAnn = annotatedElement.getAnnotation( GenericGenerators.class );
    if ( defAnn != null ) {
      bindGenericGenerator( defAnn, mappings );
    }
    if ( defsAnn != null ) {
View Full Code Here

      }
      idGen.addParam( SequenceHiLoGenerator.MAX_LO, String.valueOf( seqGen.allocationSize() - 1 ) );
      log.debug( "Add sequence generator with name: {}", idGen.getName() );
    }
    else if ( ann instanceof GenericGenerator ) {
      GenericGenerator genGen = (GenericGenerator) ann;
      idGen.setName( genGen.name() );
      idGen.setIdentifierGeneratorStrategy( genGen.strategy() );
      Parameter[] params = genGen.parameters();
      for (Parameter parameter : params) {
        idGen.addParam( parameter.name(), parameter.value() );
      }
      log.debug( "Add generic generator with name: {}", idGen.getName() );
    }
View Full Code Here

  private static HashMap<String, IdGenerator> buildLocalGenerators(XAnnotatedElement annElt, Mappings mappings) {
    HashMap<String, IdGenerator> generators = new HashMap<String, IdGenerator>();
    TableGenerator tabGen = annElt.getAnnotation( TableGenerator.class );
    SequenceGenerator seqGen = annElt.getAnnotation( SequenceGenerator.class );
    GenericGenerator genGen = annElt.getAnnotation( GenericGenerator.class );
    if ( tabGen != null ) {
      IdGenerator idGen = buildIdGenerator( tabGen, mappings );
      generators.put( idGen.getName(), idGen );
    }
    if ( seqGen != null ) {
View Full Code Here

  private static HashMap<String, IdGenerator> buildLocalGenerators(XAnnotatedElement annElt, Mappings mappings) {
    HashMap<String, IdGenerator> generators = new HashMap<String, IdGenerator>();
    TableGenerator tabGen = annElt.getAnnotation( TableGenerator.class );
    SequenceGenerator seqGen = annElt.getAnnotation( SequenceGenerator.class );
    GenericGenerator genGen = annElt.getAnnotation( GenericGenerator.class );
    if ( tabGen != null ) {
      IdGenerator idGen = buildIdGenerator( tabGen, mappings );
      generators.put( idGen.getName(), idGen );
    }
    if ( seqGen != null ) {
View Full Code Here

    bindFetchProfiles( pckg, mappings );
    BinderHelper.bindAnyMetaDefs( pckg, mappings );
  }

  private static void bindGenericGenerators(XAnnotatedElement annotatedElement, Mappings mappings) {
    GenericGenerator defAnn = annotatedElement.getAnnotation( GenericGenerator.class );
    GenericGenerators defsAnn = annotatedElement.getAnnotation( GenericGenerators.class );
    if ( defAnn != null ) {
      bindGenericGenerator( defAnn, mappings );
    }
    if ( defsAnn != null ) {
View Full Code Here

        idGen.addParam( SequenceHiLoGenerator.MAX_LO, String.valueOf( seqGen.allocationSize() - 1 ) );
                LOG.trace("Add sequence generator with name: " + idGen.getName());
      }
    }
    else if ( ann instanceof GenericGenerator ) {
      GenericGenerator genGen = ( GenericGenerator ) ann;
      idGen.setName( genGen.name() );
      idGen.setIdentifierGeneratorStrategy( genGen.strategy() );
      Parameter[] params = genGen.parameters();
      for ( Parameter parameter : params ) {
        idGen.addParam( parameter.name(), parameter.value() );
      }
            LOG.trace("Add generic generator with name: " + idGen.getName());
    }
View Full Code Here

      IdGenerator idGen = buildIdGenerator( ann, mappings );
      mappings.addGenerator( idGen );

    }
    if ( pckg.isAnnotationPresent( GenericGenerator.class ) ) {
      GenericGenerator ann = pckg.getAnnotation( GenericGenerator.class );
      IdGenerator idGen = buildIdGenerator( ann, mappings );
      mappings.addGenerator( idGen );
    }
    bindQueries( pckg, mappings );
    bindFilterDefs( pckg, mappings );
View Full Code Here

      }
      idGen.addParam( SequenceHiLoGenerator.MAX_LO, String.valueOf( seqGen.allocationSize() - 1 ) );
      log.debug( "Add sequence generator with name: " + idGen.getName() );
    }
    else if ( ann instanceof GenericGenerator ) {
      GenericGenerator genGen = (GenericGenerator) ann;
      idGen.setName( genGen.name() );
      idGen.setIdentifierGeneratorStrategy( genGen.strategy() );
      Parameter[] params = genGen.parameters();
      for ( Parameter parameter : params ) {
        idGen.addParam( parameter.name(), parameter.value() );
      }
      log.debug( "Add generic generator with name: " + idGen.getName() );
    }
View Full Code Here

  private static HashMap<String, IdGenerator> buildLocalGenerators(XAnnotatedElement annElt, Mappings mappings) {
    HashMap<String, IdGenerator> generators = new HashMap<String, IdGenerator>();
    TableGenerator tabGen = annElt.getAnnotation( TableGenerator.class );
    SequenceGenerator seqGen = annElt.getAnnotation( SequenceGenerator.class );
    GenericGenerator genGen = annElt.getAnnotation( GenericGenerator.class );
    if ( tabGen != null ) {
      IdGenerator idGen = buildIdGenerator( tabGen, mappings );
      generators.put( idGen.getName(), idGen );
    }
    if ( seqGen != null ) {
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.GenericGenerator

Copyright © 2018 www.massapicom. 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.