Package javax.persistence

Examples of javax.persistence.SecondaryTables


        void onEntity(
                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            SecondaryTables annotation = element.getAnnotation(SecondaryTables.class);
            for (int i = 0; i < annotation.value().length; i++) {
                entity.getSecondaryTables().add(
                        new JpaSecondaryTable(annotation.value()[i]));
            }
        }
View Full Code Here


    if (t != null) {
      parseTable(t, sc, sc.mainTable);
    }
    // - Secondary tables
    SecondaryTable st = (SecondaryTable) c.getAnnotation(SecondaryTable.class);
    SecondaryTables sts = (SecondaryTables) c.getAnnotation(SecondaryTables.class);
    if (sts != null) {
      if (st != null) {
        nbErrors++;
        logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
            + ": cannot define both 'SecondaryTable' and 'SecondaryTables' annotations at the same time.");
      } else {
        for (SecondaryTable st2 : sts.value()) {
          parseSecondaryTable(st2, sc);
        }
      }
    } else {
      if (st != null) {
View Full Code Here

        void onEntity(
                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            SecondaryTables annotation = element.getAnnotation(SecondaryTables.class);
            for (int i = 0; i < annotation.value().length; i++) {
                entity.getSecondaryTables().add(
                        new JpaSecondaryTable(annotation.value()[i]));
            }
        }
View Full Code Here

        void onEntity(
                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            SecondaryTables annotation = element.getAnnotation(SecondaryTables.class);
            for (int i = 0; i < annotation.value().length; i++) {
                entity.getSecondaryTables().add(
                        new JpaSecondaryTable(annotation.value()[i]));
            }
        }
View Full Code Here

     * 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 );
        }
      }
    }
    if ( secondaryTables.size() > 0 ) {
View Full Code Here

     * 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 );
        }
      }
    }
    if ( secondaryTables.size() > 0 ) {
View Full Code Here

     * 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 );
        }
      }
    }
    if ( secondaryTables.size() > 0 ) {
View Full Code Here

     * 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 );
        }
      }
    }
    if ( secondaryTables.size() > 0 ) {
View Full Code Here

     * 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 );
        }
      }
    }
    if ( secondaryTables.size() > 0 ) {
View Full Code Here

    public static final SecondaryTable[] getSecondaryTables(AnnotatedElement clazz) {
        SecondaryTable[] sts = null;
        SecondaryTable stAnnotation = clazz.getAnnotation(SecondaryTable.class);
        if (stAnnotation == null) {
            SecondaryTables stsAnnotation = clazz.getAnnotation(SecondaryTables.class);
            sts = stsAnnotation != null ? stsAnnotation.value() : new SecondaryTable[0];
        } else {
            sts = new SecondaryTable[] {stAnnotation};
        }

        return sts;
View Full Code Here

TOP

Related Classes of javax.persistence.SecondaryTables

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.