HHH-6113 re-fact and more tests

This commit is contained in:
Strong Liu 2011-05-22 20:23:29 +08:00
parent c62e5fccc8
commit c1415b4b8f
4 changed files with 17 additions and 12 deletions

View File

@ -65,7 +65,7 @@ abstract class AnnotationMocker extends AbstractMocker {
}
protected boolean isDefaultCascadePersist() {
return defaults.isCascadePersist();
return defaults.isCascadePersist()!=null && defaults.isCascadePersist();
}
//@JoinTable

View File

@ -95,7 +95,7 @@ class DefaultConfigurationHelper {
if ( hasSchemaOrCatalogDefined( defaults ) ) {
applyDefaultSchemaAndCatalog( annotationsMap, defaults );
}
if ( defaults.isCascadePersist() ) {
if ( defaults.isCascadePersist()!=null && defaults.isCascadePersist() ) {
applyDefaultCascadePersist( annotationsMap );
}
}

View File

@ -165,8 +165,8 @@ public class EntityMappingsMocker {
private String packageName;
private String schema;
private String catalog;
private boolean metadataComplete;
private boolean cascadePersist;
private Boolean metadataComplete;
private Boolean cascadePersist;
public XMLAccessType getAccess() {
return access;
@ -200,19 +200,19 @@ public class EntityMappingsMocker {
this.schema = schema;
}
public boolean isMetadataComplete() {
public Boolean isMetadataComplete() {
return metadataComplete;
}
void setMetadataComplete(boolean metadataComplete) {
void setMetadataComplete(Boolean metadataComplete) {
this.metadataComplete = metadataComplete;
}
public boolean isCascadePersist() {
public Boolean isCascadePersist() {
return cascadePersist;
}
void setCascadePersist(boolean cascadePersist) {
void setCascadePersist(Boolean cascadePersist) {
this.cascadePersist = cascadePersist;
}
@ -230,8 +230,13 @@ public class EntityMappingsMocker {
if ( globalDefault.getCatalog() != null ) {
catalog = globalDefault.getCatalog();
}
metadataComplete = globalDefault.isMetadataComplete();
cascadePersist = globalDefault.isCascadePersist();
if ( globalDefault.isCascadePersist() != null ) {
cascadePersist = globalDefault.isCascadePersist();
}
if ( globalDefault.isMetadataComplete() != null ) {
metadataComplete = globalDefault.isMetadataComplete();
}
}
}
}

View File

@ -184,10 +184,10 @@ public class IndexBuilder {
// annotations classes overrided by xml
if ( indexedClassInfoAnnotationsMap.containsKey( name ) ) {
Map<DotName, List<AnnotationInstance>> tmp = getIndexedAnnotations( name );
DefaultConfigurationHelper.INSTANCE.applyDefaults( tmp, defaults );
mergeAnnotationMap( tmp, map );
}
DefaultConfigurationHelper.INSTANCE.applyDefaults( map, defaults );
mergeAnnotationMap( map, annotations );
}