Examples of SecondaryTable


Examples of javax.persistence.SecondaryTable

    /*
     * You can't have both secondary table in XML and Java,
     * since there would be no way to "remove" a secondary table
     */
    if ( secondaryTables.size() == 0 && defaults.canUseJavaAnnotations() ) {
      SecondaryTable secTableAnn = getJavaAnnotation( SecondaryTable.class );
      overridesDefaultInSecondaryTable( secTableAnn, defaults, secondaryTables );
      SecondaryTables secTablesAnn = getJavaAnnotation( SecondaryTables.class );
      if ( secTablesAnn != null ) {
        for ( SecondaryTable table : secTablesAnn.value() ) {
          overridesDefaultInSecondaryTable( table, defaults, secondaryTables );
View Full Code Here

Examples of javax.persistence.SecondaryTable

    /*
     * You can't have both secondary table in XML and Java,
     * since there would be no way to "remove" a secondary table
     */
    if ( secondaryTables.size() == 0 && defaults.canUseJavaAnnotations() ) {
      SecondaryTable secTableAnn = getJavaAnnotation( SecondaryTable.class );
      overridesDefaultInSecondaryTable( secTableAnn, defaults, secondaryTables );
      SecondaryTables secTablesAnn = getJavaAnnotation( SecondaryTables.class );
      if ( secTablesAnn != null ) {
        for ( SecondaryTable table : secTablesAnn.value() ) {
          overridesDefaultInSecondaryTable( table, defaults, secondaryTables );
View Full Code Here

Examples of javax.persistence.SecondaryTable

    {
        List<String> tables = new ArrayList<String>();

        SecondaryTables secondaryTablesAnnotation = (SecondaryTables) getAnnotation(SecondaryTables.class.getName());

        SecondaryTable secondaryTableAnnotation = (SecondaryTable) getAnnotation(SecondaryTable.class.getName());

        if (secondaryTablesAnnotation != null)
        {
            SecondaryTable[] secondaryTables = secondaryTablesAnnotation.value();

            for (SecondaryTable secondaryTable : secondaryTables)
            {
                tables.add(secondaryTable.name());
            }
        }
        else if (secondaryTableAnnotation != null)
        {
            tables.add(secondaryTableAnnotation.name());
        }
        return tables;
    }
View Full Code Here

Examples of javax.persistence.SecondaryTable

  }

  private void introspectSecondaryTable(EntityType entityType, Class type)
  {
    getInternalSecondaryTableConfig(type, _annotationCfg);
    SecondaryTable secondaryTableAnn = (SecondaryTable) _annotationCfg.getAnnotation();
    SecondaryTableConfig secondaryTableConfig = _annotationCfg.getSecondaryTableConfig();

    AmberTable secondaryTable = null;

    if ((secondaryTableAnn != null) || (secondaryTableConfig != null)) {
      String secondaryName;

      if (secondaryTableAnn != null)
  secondaryName = secondaryTableAnn.name();
      else
  secondaryName = secondaryTableConfig.getName();

      secondaryTable = _persistenceUnit.createTable(secondaryName);

      entityType.addSecondaryTable(secondaryTable);

      // XXX: pk
    }

    if (secondaryTableAnn != null) {
      PrimaryKeyJoinColumn[] joinAnn = secondaryTableAnn.pkJoinColumns();

      linkSecondaryTable(entityType.getTable(),
       secondaryTable,
       joinAnn);
    }
View Full Code Here

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

                    entity.setTable( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "secondary-table" ) )
                {
                    final SecondaryTable e = JAXB.unmarshal( new DOMSource( c.element ), SecondaryTable.class );
                    entity.getSecondaryTable().add( e );
                    acknowledge = true;
                }
                else if ( c.element.getLocalName().equals( "primary-key-join-column" ) )
                {
View Full Code Here

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

            entityData.entity.setTable(table);

            // warn about no equivalent of the consistence modes in sun file

            for (org.apache.openejb.jee.sun.SecondaryTable sunSecondaryTable : bean.getSecondaryTable()) {
                SecondaryTable secondaryTable = new SecondaryTable();
                secondaryTable.setName(sunSecondaryTable.getTableName());
                for (ColumnPair columnPair : sunSecondaryTable.getColumnPair()) {
                    SunColumnName localColumnName = new SunColumnName(columnPair.getColumnName().get(0), table.getName());
                    SunColumnName referencedColumnName = new SunColumnName(columnPair.getColumnName().get(1), table.getName());

                    // if user specified in reverse order, swap
                    if (localColumnName.table != null) {
                        SunColumnName temp = localColumnName;
                        localColumnName = referencedColumnName;
                        referencedColumnName = temp;
                    }

                    PrimaryKeyJoinColumn primaryKeyJoinColumn = new PrimaryKeyJoinColumn();
                    primaryKeyJoinColumn.setName(localColumnName.column);
                    primaryKeyJoinColumn.setReferencedColumnName(referencedColumnName.column);
                    secondaryTable.getPrimaryKeyJoinColumn().add(primaryKeyJoinColumn);
                }
            }

            for (CmpFieldMapping cmpFieldMapping : bean.getCmpFieldMapping()) {
                String fieldName = cmpFieldMapping.getFieldName();
View Full Code Here

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

            entityData.entity.setTable(table);

            // warn about no equivalent of the consistence modes in sun file

            for (org.apache.openejb.jee.sun.SecondaryTable sunSecondaryTable : bean.getSecondaryTable()) {
                SecondaryTable secondaryTable = new SecondaryTable();
                secondaryTable.setName(sunSecondaryTable.getTableName());
                for (ColumnPair columnPair : sunSecondaryTable.getColumnPair()) {
                    SunColumnName localColumnName = new SunColumnName(columnPair.getColumnName().get(0), table.getName());
                    SunColumnName referencedColumnName = new SunColumnName(columnPair.getColumnName().get(1), table.getName());

                    // if user specified in reverse order, swap
                    if (localColumnName.table != null) {
                        SunColumnName temp = localColumnName;
                        localColumnName = referencedColumnName;
                        referencedColumnName = temp;
                    }

                    PrimaryKeyJoinColumn primaryKeyJoinColumn = new PrimaryKeyJoinColumn();
                    primaryKeyJoinColumn.setName(localColumnName.column);
                    primaryKeyJoinColumn.setReferencedColumnName(referencedColumnName.column);
                    secondaryTable.getPrimaryKeyJoinColumn().add(primaryKeyJoinColumn);
                }
            }

            for (CmpFieldMapping cmpFieldMapping : bean.getCmpFieldMapping()) {
                String fieldName = cmpFieldMapping.getFieldName();
View Full Code Here

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

            entityData.entity.setTable(table);

            // warn about no equivalent of the consistence modes in sun file

            for (org.apache.openejb.jee.sun.SecondaryTable sunSecondaryTable : bean.getSecondaryTable()) {
                SecondaryTable secondaryTable = new SecondaryTable();
                secondaryTable.setName(sunSecondaryTable.getTableName());
                for (ColumnPair columnPair : sunSecondaryTable.getColumnPair()) {
                    SunColumnName localColumnName = new SunColumnName(columnPair.getColumnName().get(0), table.getName());
                    SunColumnName referencedColumnName = new SunColumnName(columnPair.getColumnName().get(1), table.getName());

                    // if user specified in reverse order, swap
                    if (localColumnName.table != null) {
                        SunColumnName temp = localColumnName;
                        localColumnName = referencedColumnName;
                        referencedColumnName = temp;
                    }

                    PrimaryKeyJoinColumn primaryKeyJoinColumn = new PrimaryKeyJoinColumn();
                    primaryKeyJoinColumn.setName(localColumnName.column);
                    primaryKeyJoinColumn.setReferencedColumnName(referencedColumnName.column);
                    secondaryTable.getPrimaryKeyJoinColumn().add(primaryKeyJoinColumn);
                }
            }

            for (CmpFieldMapping cmpFieldMapping : bean.getCmpFieldMapping()) {
                String fieldName = cmpFieldMapping.getFieldName();
View Full Code Here

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

            entityData.entity.setTable(table);

            // warn about no equivalent of the consistence modes in sun file

            for (final org.apache.openejb.jee.sun.SecondaryTable sunSecondaryTable : bean.getSecondaryTable()) {
                final SecondaryTable secondaryTable = new SecondaryTable();
                secondaryTable.setName(sunSecondaryTable.getTableName());
                for (final ColumnPair columnPair : sunSecondaryTable.getColumnPair()) {
                    SunColumnName localColumnName = new SunColumnName(columnPair.getColumnName().get(0), table.getName());
                    SunColumnName referencedColumnName = new SunColumnName(columnPair.getColumnName().get(1), table.getName());

                    // if user specified in reverse order, swap
                    if (localColumnName.table != null) {
                        final SunColumnName temp = localColumnName;
                        localColumnName = referencedColumnName;
                        referencedColumnName = temp;
                    }

                    final PrimaryKeyJoinColumn primaryKeyJoinColumn = new PrimaryKeyJoinColumn();
                    primaryKeyJoinColumn.setName(localColumnName.column);
                    primaryKeyJoinColumn.setReferencedColumnName(referencedColumnName.column);
                    secondaryTable.getPrimaryKeyJoinColumn().add(primaryKeyJoinColumn);
                }
            }

            for (final CmpFieldMapping cmpFieldMapping : bean.getCmpFieldMapping()) {
                final String fieldName = cmpFieldMapping.getFieldName();
View Full Code Here

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

            entityData.entity.setTable(table);

            // warn about no equivalent of the consistence modes in sun file

            for (org.apache.openejb.jee.sun.SecondaryTable sunSecondaryTable : bean.getSecondaryTable()) {
                SecondaryTable secondaryTable = new SecondaryTable();
                secondaryTable.setName(sunSecondaryTable.getTableName());
                for (ColumnPair columnPair : sunSecondaryTable.getColumnPair()) {
                    SunColumnName localColumnName = new SunColumnName(columnPair.getColumnName().get(0), table.getName());
                    SunColumnName referencedColumnName = new SunColumnName(columnPair.getColumnName().get(1), table.getName());

                    // if user specified in reverse order, swap
                    if (localColumnName.table != null) {
                        SunColumnName temp = localColumnName;
                        localColumnName = referencedColumnName;
                        referencedColumnName = temp;
                    }

                    PrimaryKeyJoinColumn primaryKeyJoinColumn = new PrimaryKeyJoinColumn();
                    primaryKeyJoinColumn.setName(localColumnName.column);
                    primaryKeyJoinColumn.setReferencedColumnName(referencedColumnName.column);
                    secondaryTable.getPrimaryKeyJoinColumn().add(primaryKeyJoinColumn);
                }
            }

            for (CmpFieldMapping cmpFieldMapping : bean.getCmpFieldMapping()) {
                String fieldName = cmpFieldMapping.getFieldName();
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.