Examples of TableGenerator


Examples of javax.persistence.TableGenerator

    public long getNextSequence(long hostId) {
        if (s_logger.isTraceEnabled()) {
            s_logger.trace("getNextSequence(), hostId: " + hostId);
        }

        TableGenerator tg = _tgs.get("host_req_sq");
        assert tg != null : "how can this be wrong!";

        return s_seqFetcher.getNextSequence(Long.class, tg, hostId);
    }
View Full Code Here

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

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

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

        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) {
        Map<String, Object> tableGeneratorProps = new HashMap<String, Object>();
        tableGeneratorProps.put("name", tableGenerator.getName()); //$NON-NLS-1$
        tableGeneratorProps.put("table", tableGenerator.getTable()); //$NON-NLS-1$
        tableGeneratorProps.put("catalog", tableGenerator.getCatalog()); //$NON-NLS-1$
        tableGeneratorProps.put("schema", tableGenerator.getSchema()); //$NON-NLS-1$
        tableGeneratorProps.put("pkColumnName", tableGenerator.getPkColumnName()); //$NON-NLS-1$
        tableGeneratorProps.put("valueColumnName", tableGenerator.getValueColumnName()); //$NON-NLS-1$
        tableGeneratorProps.put("pkColumnValue", tableGenerator.getPkColumnValue()); //$NON-NLS-1$
        tableGeneratorProps.put("initialValue", tableGenerator.getInitialValue().intValue()); //$NON-NLS-1$
        tableGeneratorProps.put("allocationSize", tableGenerator.getAllocationSize().intValue()); //$NON-NLS-1$

        List uniqueConstraintPropsList = new ArrayList();

        List<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraint();
        for (UniqueConstraint uniqueConstriant : uniqueConstraints) {
          Map<String, Object> uniqueConstraintProps = new HashMap<String, Object>();
          List<String> columns = uniqueConstriant.getColumnName();
          uniqueConstraintProps.put("columnNames", columns.toArray(new String[0])); //$NON-NLS-1$
          uniqueConstraintPropsList.add(uniqueConstraintProps);
View Full Code Here

Examples of org.hibernate.id.enhanced.TableGenerator

  public void testMinimalTableEntity() {
    final EntityPersister persister = sfi().getEntityPersister( MinimalTableEntity.class.getName() );
    IdentifierGenerator generator = persister.getIdentifierGenerator();
    assertTrue( TableGenerator.class.isInstance( generator ) );
    TableGenerator tabGenerator = (TableGenerator) generator;
    assertEquals( MinimalTableEntity.TBL_NAME, tabGenerator.getTableName() );
    assertEquals( TableGenerator.DEF_SEGMENT_COLUMN, tabGenerator.getSegmentColumnName() );
    assertEquals( "MINIMAL_TBL", tabGenerator.getSegmentValue() );
    assertEquals( TableGenerator.DEF_VALUE_COLUMN, tabGenerator.getValueColumnName() );
    // 0 is the annotation default, but its expected to be treated as 1
    assertEquals( 1, tabGenerator.getInitialValue() );
    // 50 is the annotation default
    assertEquals( 50, tabGenerator.getIncrementSize() );
    assertTrue( OptimizerFactory.PooledOptimizer.class.isInstance( tabGenerator.getOptimizer() ) );
  }
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.