Package javax.persistence

Examples of javax.persistence.Table


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

            Table annotation = element.getAnnotation(Table.class);
            entity.setTable(new JpaTable(annotation));
        }
View Full Code Here


        // this is ok, super class might not be an enitity
      }
    }

    // determine column family name
    Table tbl = theType.getAnnotation(Table.class);
    if (null == cfBaseMapDef) {
      if (null != tbl) {
        // make sure the column family is not already used
        CFMappingDef<?, ?> tmpDef;
        if ( null != (tmpDef=getCfMapDef(tbl.name(), false))) {
          throw new IllegalStateException("classes, " + clazz.getName() + " and " + tmpDef.getClazz().getName() + ", are both mapped to ColumnFamily, " + tbl.name() + ".  Can only have one class/ColumnFamily mapping - if multiple classes can be derived from a single ColumnFamily, use @"+Inheritance.class.getSimpleName() );
        }
        cfMapDef.setColFamName(tbl.name());
      }
      else {
        cfMapDef.setColFamName(theType.getSimpleName());
      }
    }
View Full Code Here

      }
    }

    // ---------------------------------------------------------------------
    // Define name for Primary Table (parse definition later...)
    Table t = (Table) c.getAnnotation(Table.class);
    if (t == null) { // There is no Table annotation: use defaults
      sc.mainTable.name = sc.name;
    } else {
      sc.mainTable.name = t.name();
    }

    // ---------------------------------------------------------------------
    // Parse the attribute information for retrieving mapping information
    if (c.getAnnotation(IdClass.class) != null) {
View Full Code Here

        for (Annotation annotation : annotations)
        {
            if (annotation.annotationType().equals(javax.persistence.Table.class))
            {
                Table table = (Table) annotation;

                if (table.name().toUpperCase().compareTo(className) != 0)
                  throw new EntityCheckWrongTableNameException(beanName,table.name());

                return true;
            }
        }
View Full Code Here

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

            Table annotation = element.getAnnotation(Table.class);
            entity.setTable(new JpaTable(annotation));
        }
View Full Code Here

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

            Table annotation = element.getAnnotation(Table.class);
            entity.setTable(new JpaTable(annotation));
        }
View Full Code Here

      //no element but might have some default or some annotation
      if ( StringHelper.isNotEmpty( defaults.getCatalog() )
          || StringHelper.isNotEmpty( defaults.getSchema() ) ) {
        AnnotationDescriptor annotation = new AnnotationDescriptor( Table.class );
        if ( defaults.canUseJavaAnnotations() ) {
          Table table = getJavaAnnotation( Table.class );
          if ( table != null ) {
            annotation.setValue( "name", table.name() );
            annotation.setValue( "schema", table.schema() );
            annotation.setValue( "catalog", table.catalog() );
            annotation.setValue( "uniqueConstraints", table.uniqueConstraints() );
          }
        }
        if ( StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) )
            && StringHelper.isNotEmpty( defaults.getSchema() ) ) {
          annotation.setValue( "schema", defaults.getSchema() );
View Full Code Here

  }
 
  /** return table name or null */
  protected String getEntityTableName(Object entity) throws ClassNotFoundException {
    Class tableName = Class.forName("javax.persistence.Table");
    Table table = ( Table ) entity.getClass().getAnnotation(tableName);
    return (table == null) ? null : table.name();
  }
View Full Code Here

            System.out.println(stringListClass.getName());
           
            Class inverseJoinColumnClass = Class.forName(stringListClass.getName());
           
            Class tableName = Class.forName("javax.persistence.Table");
          Table table =( Table ) inverseJoinColumnClass.getAnnotation(tableName);
         
          if(table == null && (table.name() == null || StringUtils.isBlank(table.name()))) {
                        throw new ActivationException("Exception! There is no @Table or name par. is empty! Please check your data !");
                    }

//          if(table.name() != null || !table.name().equals("")){
            inverseJoinColumnTableName = table.name();
            System.out.println(inverseJoinColumnTableName);
//          }

          if(joinTableName != null && joinColumnOne != null && joinColumnTwo != null && joinColumnTableName != null && inverseJoinColumnTableName != null) {
                        queryBuilder = new StringBuilder(CREATE_TABLE);
View Full Code Here

      //no element but might have some default or some annotation
      if ( StringHelper.isNotEmpty( defaults.getCatalog() )
          || StringHelper.isNotEmpty( defaults.getSchema() ) ) {
        AnnotationDescriptor annotation = new AnnotationDescriptor( Table.class );
        if ( defaults.canUseJavaAnnotations() ) {
          Table table = getJavaAnnotation( Table.class );
          if ( table != null ) {
            annotation.setValue( "name", table.name() );
            annotation.setValue( "schema", table.schema() );
            annotation.setValue( "catalog", table.catalog() );
            annotation.setValue( "uniqueConstraints", table.uniqueConstraints() );
          }
        }
        if ( StringHelper.isEmpty( (String) annotation.valueOf( "schema" ) )
            && StringHelper.isNotEmpty( defaults.getSchema() ) ) {
          annotation.setValue( "schema", defaults.getSchema() );
View Full Code Here

TOP

Related Classes of javax.persistence.Table

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.