From ec0e823b64d1dea23f3ce847346ba293ce02319f Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Tue, 31 May 2011 11:16:32 +0200 Subject: [PATCH] HHH-6261 formatting --- .../annotations/entity/EntityBinder.java | 22 ++++++++++++------- .../source/spi/MetadataImplementor.java | 6 ++--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBinder.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBinder.java index 4d14c5eea2..6427e0ead2 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/annotations/entity/EntityBinder.java @@ -26,7 +26,6 @@ package org.hibernate.metamodel.source.annotations.entity; import java.util.HashMap; import java.util.List; import java.util.Map; - import javax.persistence.GenerationType; import org.jboss.jandex.AnnotationInstance; @@ -45,8 +44,8 @@ import org.hibernate.id.factory.DefaultIdentifierGeneratorFactory; import org.hibernate.internal.util.StringHelper; import org.hibernate.metamodel.binding.Caching; import org.hibernate.metamodel.binding.EntityBinding; -import org.hibernate.metamodel.binding.IdGenerator; import org.hibernate.metamodel.binding.EntityDiscriminator; +import org.hibernate.metamodel.binding.IdGenerator; import org.hibernate.metamodel.binding.ManyToOneAttributeBinding; import org.hibernate.metamodel.binding.SimpleAttributeBinding; import org.hibernate.metamodel.binding.state.DiscriminatorBindingState; @@ -354,8 +353,7 @@ public class EntityBinder { } - - private void bindSingleIdGeneratedValue(EntityBinding entityBinding,String idPropertyName){ + private void bindSingleIdGeneratedValue(EntityBinding entityBinding, String idPropertyName) { AnnotationInstance generatedValueAnn = JandexHelper.getSingleAnnotation( configuredClass.getClassInfo(), JPADotNames.GENERATED_VALUE ); @@ -389,8 +387,15 @@ public class EntityBinder { } entityBinding.getEntityIdentifier().setIdGenerator( idGenerator ); } - GenerationType generationType = JandexHelper.getValueAsEnum( generatedValueAnn, "strategy", GenerationType.class ); - String strategy = DefaultIdentifierGeneratorFactory.generatorType( generationType, meta.getOptions().useNewIdentifierGenerators() ); + GenerationType generationType = JandexHelper.getValueAsEnum( + generatedValueAnn, + "strategy", + GenerationType.class + ); + String strategy = DefaultIdentifierGeneratorFactory.generatorType( + generationType, + meta.getOptions().useNewIdentifierGenerators() + ); if ( idGenerator != null && !strategy.equals( idGenerator.getStrategy() ) ) { //todo how to ? throw new MappingException( @@ -400,8 +405,9 @@ public class EntityBinder { idName ) ); - } else{ - idGenerator = new IdGenerator( "NAME", strategy, new HashMap( ) ); + } + else { + idGenerator = new IdGenerator( "NAME", strategy, new HashMap() ); entityBinding.getEntityIdentifier().setIdGenerator( idGenerator ); } } diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/spi/MetadataImplementor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/spi/MetadataImplementor.java index 82bbe79284..4c59411827 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/spi/MetadataImplementor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/spi/MetadataImplementor.java @@ -23,8 +23,6 @@ */ package org.hibernate.metamodel.source.spi; -import java.util.Map; - import org.hibernate.engine.spi.FilterDefinition; import org.hibernate.metamodel.Metadata; import org.hibernate.metamodel.binding.EntityBinding; @@ -40,9 +38,11 @@ import org.hibernate.type.TypeResolver; */ public interface MetadataImplementor extends Metadata { public BasicServiceRegistry getServiceRegistry(); + public Database getDatabase(); public Iterable getEntityBindings(); + public EntityBinding getEntityBinding(String entityName); public TypeResolver getTypeResolver(); @@ -53,7 +53,7 @@ public interface MetadataImplementor extends Metadata { public void addCollection(PluralAttributeBinding collectionBinding); - public void addFetchProfile( FetchProfile profile ); + public void addFetchProfile(FetchProfile profile); public void addTypeDef(TypeDef typeDef);