Package javax.persistence

Examples of javax.persistence.Entity


    static final class EntityProcessor implements AnnotationProcessor {

        public void onStartElement(
                AnnotatedElement element,
                AnnotationProcessorStack context) {
            Entity entityAnnotation = element.getAnnotation(Entity.class);

            JpaEntity entity = new JpaEntity();
            entity.setClassName(((Class<?>) element).getName());
            entity.setAttributes(new JpaAttributes());

            if (!Util.isEmptyString(entityAnnotation.name())) {
                entity.setName(entityAnnotation.name());
            }

            context.push(entity);
        }
View Full Code Here


        }
    }

    protected static String getEntityName(Class<?> clazz) {

        Entity entity = clazz.getAnnotation(Entity.class);

        // Check if the property name has been defined for Entity annotation
        if (!entity.name().equals("")) {
            return entity.name();
        } else {
            return null;
        }

    }
View Full Code Here

            }
        }
    }
   
    protected String getEntityName(Class<?> clazz) {
        Entity entity = clazz.getAnnotation(Entity.class);

        // Check if the property name has been defined for Entity annotation
        if (entity != null && !entity.name().equals("")) {
            return entity.name();
        } else {
            return null;
        }
    }
View Full Code Here

            }
        }
    }
   
    protected String getEntityName(Class<?> clazz) {
        Entity entity = clazz.getAnnotation(Entity.class);

        // Check if the property name has been defined for Entity annotation
        if (entity != null && !entity.name().equals("")) {
            return entity.name();
        } else {
            return null;
        }
    }
View Full Code Here

    static final class EntityProcessor implements AnnotationProcessor {

        public void onStartElement(
                AnnotatedElement element,
                AnnotationProcessorStack context) {
            Entity entityAnnotation = element.getAnnotation(Entity.class);

            JpaEntity entity = new JpaEntity();
            entity.setClassName(((Class) element).getName());
            entity.setAttributes(new JpaAttributes());

            if (!Util.isEmptyString(entityAnnotation.name())) {
                entity.setName(entityAnnotation.name());
            }

            context.push(entity);
        }
View Full Code Here

    PersistentClass superEntity = getSuperEntity(
        clazzToProcess, inheritanceStatePerClass, mappings, inheritanceState
    );

    PersistentClass persistentClass = makePersistentClass( inheritanceState, superEntity );
    Entity entityAnn = clazzToProcess.getAnnotation( Entity.class );
    org.hibernate.annotations.Entity hibEntityAnn = clazzToProcess.getAnnotation(
        org.hibernate.annotations.Entity.class
    );
    EntityBinder entityBinder = new EntityBinder(
        entityAnn, hibEntityAnn, clazzToProcess, persistentClass, mappings
View Full Code Here

      if ( "entity".equals( tree.getName() ) ) {
        AnnotationDescriptor entity = new AnnotationDescriptor( Entity.class );
        copyStringAttribute( entity, tree, "name", false );
        if ( defaults.canUseJavaAnnotations()
            && StringHelper.isEmpty( (String) entity.valueOf( "name" ) ) ) {
          Entity javaAnn = getJavaAnnotation( Entity.class );
          if ( javaAnn != null ) {
            entity.setValue( "name", javaAnn.name() );
          }
        }
        return AnnotationFactory.create( entity );
      }
      else {
View Full Code Here

      throw new AssertionFailure( "Unknown inheritance type: " + inheritanceState.type );
    }
    Proxy proxyAnn = annotatedClass.getAnnotation( Proxy.class );
    BatchSize sizeAnn = annotatedClass.getAnnotation( BatchSize.class );
    Where whereAnn = annotatedClass.getAnnotation( Where.class );
    Entity entityAnn = annotatedClass.getAnnotation( Entity.class );
    org.hibernate.annotations.Entity hibEntityAnn = annotatedClass.getAnnotation(
        org.hibernate.annotations.Entity.class
    );
    org.hibernate.annotations.Cache cacheAnn = annotatedClass.getAnnotation(
        org.hibernate.annotations.Cache.class
View Full Code Here

    PersistentClass superEntity = getSuperEntity(
        clazzToProcess, inheritanceStatePerClass, mappings, inheritanceState
    );

    PersistentClass persistentClass = makePersistentClass( inheritanceState, superEntity );
    Entity entityAnn = clazzToProcess.getAnnotation( Entity.class );
    org.hibernate.annotations.Entity hibEntityAnn = clazzToProcess.getAnnotation(
        org.hibernate.annotations.Entity.class
    );
    EntityBinder entityBinder = new EntityBinder(
        entityAnn, hibEntityAnn, clazzToProcess, persistentClass, mappings
View Full Code Here

            }
        }
    }
   
    protected String getEntityName(Class<?> clazz) {
        Entity entity = clazz.getAnnotation(Entity.class);

        // Check if the property name has been defined for Entity annotation
        if (entity != null && !entity.name().equals("")) {
            return entity.name();
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of javax.persistence.Entity

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.