HHH-6261 formatting

This commit is contained in:
Hardy Ferentschik 2011-05-31 11:16:32 +02:00
parent 19f629b461
commit ec0e823b64
2 changed files with 17 additions and 11 deletions

View File

@ -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,7 +353,6 @@ public class EntityBinder {
}
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,7 +405,8 @@ public class EntityBinder {
idName
)
);
} else{
}
else {
idGenerator = new IdGenerator( "NAME", strategy, new HashMap<String, String>() );
entityBinding.getEntityIdentifier().setIdGenerator( idGenerator );
}

View File

@ -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<EntityBinding> getEntityBindings();
public EntityBinding getEntityBinding(String entityName);
public TypeResolver getTypeResolver();