simple code refact

This commit is contained in:
Strong Liu 2011-08-01 13:51:32 +08:00
parent cc2dab0f18
commit 67e8f311db
1 changed files with 11 additions and 13 deletions

View File

@ -157,16 +157,14 @@ public class Binder {
return makeRootEntityBinding( (RootEntitySource) entitySource ); return makeRootEntityBinding( (RootEntitySource) entitySource );
} }
else { else {
if ( currentInheritanceType == InheritanceType.SINGLE_TABLE ) { switch ( currentInheritanceType ){
case SINGLE_TABLE:
return makeDiscriminatedSubclassBinding( (SubclassEntitySource) entitySource, superEntityBinding ); return makeDiscriminatedSubclassBinding( (SubclassEntitySource) entitySource, superEntityBinding );
} case JOINED:
else if ( currentInheritanceType == InheritanceType.JOINED ) {
return makeJoinedSubclassBinding( (SubclassEntitySource) entitySource, superEntityBinding ); return makeJoinedSubclassBinding( (SubclassEntitySource) entitySource, superEntityBinding );
} case TABLE_PER_CLASS:
else if ( currentInheritanceType == InheritanceType.TABLE_PER_CLASS ) {
return makeUnionedSubclassBinding( (SubclassEntitySource) entitySource, superEntityBinding ); return makeUnionedSubclassBinding( (SubclassEntitySource) entitySource, superEntityBinding );
} default:
else {
// extreme internal error! // extreme internal error!
throw new AssertionFailure( "Internal condition failure" ); throw new AssertionFailure( "Internal condition failure" );
} }