Examples of SequenceGenerator


Examples of javax.persistence.SequenceGenerator

        void onEntityMap(
                JpaEntityMap entityMap,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            SequenceGenerator annotation = element.getAnnotation(SequenceGenerator.class);
            entityMap.getSequenceGenerators().add(new JpaSequenceGenerator(annotation));
        }
View Full Code Here

Examples of javax.persistence.SequenceGenerator

    catch ( ClassNotFoundException cnf ) {
            LOG.packageNotFound(packageName);
      return;
    }
    if ( pckg.isAnnotationPresent( SequenceGenerator.class ) ) {
      SequenceGenerator ann = pckg.getAnnotation( SequenceGenerator.class );
      IdGenerator idGen = buildIdGenerator( ann, mappings );
      mappings.addGenerator( idGen );
            LOG.trace("Add sequence generator with name: " + idGen.getName());
    }
    if ( pckg.isAnnotationPresent( TableGenerator.class ) ) {
View Full Code Here

Examples of javax.persistence.SequenceGenerator

        idGen.addParam( TableHiLoGenerator.MAX_LO, String.valueOf( tabGen.allocationSize() - 1 ) );
      }
            LOG.trace("Add table generator with name: " + idGen.getName());
    }
    else if ( ann instanceof SequenceGenerator ) {
      SequenceGenerator seqGen = ( SequenceGenerator ) ann;
      idGen.setName( seqGen.name() );
      if ( useNewGeneratorMappings ) {
        idGen.setIdentifierGeneratorStrategy( SequenceStyleGenerator.class.getName() );

        if ( !BinderHelper.isEmptyAnnotationValue( seqGen.catalog() ) ) {
          idGen.addParam( PersistentIdentifierGenerator.CATALOG, seqGen.catalog() );
        }
        if ( !BinderHelper.isEmptyAnnotationValue( seqGen.schema() ) ) {
          idGen.addParam( PersistentIdentifierGenerator.SCHEMA, seqGen.schema() );
        }
        if ( !BinderHelper.isEmptyAnnotationValue( seqGen.sequenceName() ) ) {
          idGen.addParam( SequenceStyleGenerator.SEQUENCE_PARAM, seqGen.sequenceName() );
        }
        idGen.addParam( SequenceStyleGenerator.INCREMENT_PARAM, String.valueOf( seqGen.allocationSize() ) );
        idGen.addParam( SequenceStyleGenerator.INITIAL_PARAM, String.valueOf( seqGen.initialValue() ) );
      }
      else {
        idGen.setIdentifierGeneratorStrategy( "seqhilo" );

        if ( !BinderHelper.isEmptyAnnotationValue( seqGen.sequenceName() ) ) {
          idGen.addParam( org.hibernate.id.SequenceGenerator.SEQUENCE, seqGen.sequenceName() );
        }
        //FIXME: work on initialValue() through SequenceGenerator.PARAMETERS
        //    steve : or just use o.h.id.enhanced.SequenceStyleGenerator
                if (seqGen.initialValue() != 1) LOG.unsupportedInitialValue(Configuration.USE_NEW_ID_GENERATOR_MAPPINGS);
        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;
View Full Code Here

Examples of javax.persistence.SequenceGenerator

  }

  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 );
    }
View Full Code Here

Examples of net.sourceforge.jpaxjc.ns.persistence.orm.SequenceGenerator

                    orm.setAccess( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "sequence-generator" ) )
                {
                    final SequenceGenerator e = JAXB.unmarshal( new DOMSource( c.element ), SequenceGenerator.class );
                    orm.getSequenceGenerator().add( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "table-generator" ) )
                {
View Full Code Here

Examples of net.sourceforge.jpaxjc.ns.persistence.orm.SequenceGenerator

                    entity.setDiscriminatorColumn( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "sequence-generator" ) )
                {
                    final SequenceGenerator e = JAXB.unmarshal( new DOMSource( c.element ), SequenceGenerator.class );
                    entity.setSequenceGenerator( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "table-generator" ) )
                {
View Full Code Here

Examples of org.apache.derby.impl.sql.catalog.SequenceGenerator

             long restartValue
             )
        {
            _valueOnDisk = currentValue;
           
            _sequenceGenerator = new SequenceGenerator
                (
                 currentValue,
                 canCycle,
                 increment,
                 maxValue,
View Full Code Here

Examples of org.apache.derby.impl.sql.catalog.SequenceGenerator

             long restartValue
             )
        {
            _valueOnDisk = currentValue;
           
            _sequenceGenerator = new SequenceGenerator
                (
                 currentValue,
                 canCycle,
                 increment,
                 maxValue,
View Full Code Here

Examples of org.apache.openejb.jee.jpa.SequenceGenerator

          break;
        }

        facade.addMethodAnnotation(entityBean.getEjbClass(), methodName, emptySignature, javax.persistence.GeneratedValue.class, generatedValueProps);
      }
      SequenceGenerator sequenceGenerator = id.getSequenceGenerator();
      if (sequenceGenerator != null) {
        Map<String, Object> sequenceGeneratorProps = new HashMap<String, Object>();
        sequenceGeneratorProps.put("name", sequenceGenerator.getName()); //$NON-NLS-1$
        sequenceGeneratorProps.put("sequenceName", sequenceGenerator.getSequenceName()); //$NON-NLS-1$
        sequenceGeneratorProps.put("initialValue", sequenceGenerator.getInitialValue().intValue()); //$NON-NLS-1$
        sequenceGeneratorProps.put("allocationSize", sequenceGenerator.getAllocationSize().intValue()); //$NON-NLS-1$

        facade.addMethodAnnotation(entityBean.getEjbClass(), methodName, emptySignature, javax.persistence.SequenceGenerator.class, sequenceGeneratorProps);
      }
      TableGenerator tableGenerator = id.getTableGenerator();
      if (tableGenerator != null) {
View Full Code Here

Examples of org.hibernate.id.SequenceGenerator

                            null,
                            null,
                            (RootClass) persistentClass
                    );
                    if (ig instanceof SequenceGenerator) {
                        SequenceGenerator sequenceGenerator = (SequenceGenerator) ig;
                        createSequence(sequenceGenerator.getSequenceName(), schema);
                    } else if (ig instanceof SequenceStyleGenerator) {
                        SequenceStyleGenerator sequenceGenerator = (SequenceStyleGenerator) ig;
                        createSequence((String) sequenceGenerator.generatorKey(), schema);
                    }
                }
               
            }
        }
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.