Package javax.persistence

Examples of javax.persistence.Entity


    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


        // find / create metadata
        ClassMetaData meta = (m == null) ? getMetaData() : m;
        if (meta == null)
            return null;

        Entity entity = _cls.getAnnotation(Entity.class);
        MappedSuperclass mapped = _cls.getAnnotation(MappedSuperclass.class);
        Embeddable embeddable = _cls.getAnnotation(Embeddable.class);
        if (isMetaDataMode()) {
            meta.setAbstract(mapped != null);
            if (embeddable != null) meta.setEmbeddable();
            // while the spec only provides for embedded exclusive, it doesn't
            // seem hard to support otherwise
            if (entity == null)
                meta.setEmbeddedOnly(true);
            else {
                meta.setEmbeddedOnly(false);
                if (!StringUtils.isEmpty(entity.name()))
                    meta.setTypeAlias(entity.name());
            }
        }

        // track fetch groups to parse them after fields, since they
        // rely on field metadata
View Full Code Here

   * (non-Javadoc)
   * @see org.springframework.data.jpa.repository.support.JpaEntityMetadata#getEntityName()
   */
  public String getEntityName() {

    Entity entity = domainType.getAnnotation(Entity.class);
    boolean hasName = null != entity && StringUtils.hasText(entity.name());

    return hasName ? entity.name() : domainType.getSimpleName();
  }
View Full Code Here

     * @param c
     * @return
     */
    public AnnotationInfo putAnnotationInfo(Class c) {
        {
            Entity entity = (Entity) c.getAnnotation(Entity.class);
            if(entity == null){
                throw new PersistenceException("Class not marked as an @Entity: " + c.getName());
            }
        }
        AnnotationInfo ai = new AnnotationInfo();
        ai.setClassAnnotations(c.getAnnotations());
        ai.setMainClass(c);
        Class superClass = c;
        Class rootClass = null;
        while ((superClass = superClass.getSuperclass()) != null) {
            MappedSuperclass mappedSuperclass = (MappedSuperclass) superClass.getAnnotation(MappedSuperclass.class);
            Entity entity = (Entity) superClass.getAnnotation(Entity.class);
            Inheritance inheritance = (Inheritance) superClass.getAnnotation(Inheritance.class);
            if (mappedSuperclass != null || entity != null) {
                putProperties(ai, superClass);
                putMethods(ai, superClass);
                if (entity != null) {
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

    PersistentClass persistentClass = makePersistentClass( inheritanceState, superEntity );

    Proxy proxyAnn = clazzToProcess.getAnnotation( Proxy.class );
    BatchSize sizeAnn = clazzToProcess.getAnnotation( BatchSize.class );
    Where whereAnn = clazzToProcess.getAnnotation( Where.class );
    Entity entityAnn = clazzToProcess.getAnnotation( Entity.class );
    org.hibernate.annotations.Entity hibEntityAnn = clazzToProcess.getAnnotation(
        org.hibernate.annotations.Entity.class
    );

    Cache cacheAnn = determineCacheSettings( clazzToProcess, 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

    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

      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

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.