Package javax.persistence

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


    /*
     * 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

    {
        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

  }

  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

TOP

Related Classes of javax.persistence.SecondaryTable

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.