private Entity getEntity(Element tree, XMLContext.Default defaults) { if ( tree == null ) { return defaults.canUseJavaAnnotations() ? getPhysicalAnnotation( Entity.class ) : null; } else { 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 = getPhysicalAnnotation( Entity.class ); if ( javaAnn != null ) { entity.setValue( "name", javaAnn.name() ); } } return AnnotationFactory.create( entity ); } else { return null; //this is not an entity } } }
String annotateEntityName = clazz.getAnnotation(Entity.class).name(); if (!StringUtils.isBlank(annotateEntityName))
private Entity getEntity(Element tree, XMLContext.Default defaults) { if ( tree == null ) { return defaults.canUseJavaAnnotations() ? getJavaAnnotation( Entity.class ) : null; } else { 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 { return null; //this is not an entity } } }
@SuppressWarnings("unchecked") private String getListTableName(Class entityClass) { Entity entity = (Entity) entityClass.getAnnotation(Entity.class); Assert.notNull(entity, "No Entity annotation found in " + entityClass.getSimpleName()); Assert.hasText(entity.name(), "Entity name is empty in Entity annotation for " + entityClass.getSimpleName()); return entity.name(); }
private String getEntityName(Class<?> clazz) { final Entity entityAnnotation = clazz.getAnnotation(Entity.class); if (entityAnnotation != null && entityAnnotation.name().length() > 0) { return entityAnnotation.name(); } else if (clazz.getPackage() != null) { String pn = clazz.getPackage().getName(); return clazz.getName().substring(pn.length() + 1); } else { return clazz.getName(); } }
private void bindEjb3Annotation(Entity ejb3Ann) { if ( ejb3Ann == null ) throw new AssertionFailure( "@Entity should always be not null" ); if ( BinderHelper.isDefault( ejb3Ann.name() ) ) { name = StringHelper.unqualify( annotatedClass.getName() ); } else { name = ejb3Ann.name(); } }
@Override public String getEntityName(Class<?> clazz) { Entity entityAnnotation = clazz.getAnnotation(Entity.class); Table tableAnnotation = clazz.getAnnotation(Table.class); if (entityAnnotation != null && stringNotEmpty(entityAnnotation.name())) { return entityAnnotation.name(); } if (tableAnnotation != null && stringNotEmpty(tableAnnotation.name())) { return tableAnnotation.name(); } return null; }
@Override public String getEntityName(Class<?> clazz) { Entity entityAnnotation = clazz.getAnnotation(Entity.class); Table tableAnnotation = clazz.getAnnotation(Table.class); if (entityAnnotation != null && stringNotEmpty(entityAnnotation.name())) { return entityAnnotation.name(); } if (tableAnnotation != null && stringNotEmpty(tableAnnotation.name())) { return tableAnnotation.name(); } return null; }