@@ -88,7 +88,7 @@ public CascadeStyle CascadeStyle
88
88
IType type = propertyValue . Type ;
89
89
if ( type . IsComponentType && ! type . IsAnyType )
90
90
{
91
- IAbstractComponentType actype = ( IAbstractComponentType ) propertyValue . Type ;
91
+ IAbstractComponentType actype = ( IAbstractComponentType ) propertyValue . Type ;
92
92
int length = actype . Subtypes . Length ;
93
93
for ( int i = 0 ; i < length ; i ++ )
94
94
{
@@ -100,36 +100,22 @@ public CascadeStyle CascadeStyle
100
100
101
101
return CascadeStyle . None ;
102
102
}
103
+ else if ( string . IsNullOrEmpty ( cascade ) || cascade . Equals ( "none" ) )
104
+ {
105
+ return CascadeStyle . None ;
106
+ }
103
107
else
104
108
{
105
- if ( cascade . Equals ( "all" ) )
106
- {
107
- return CascadeStyle . All ;
108
- }
109
- else if ( cascade . Equals ( "all-delete-orphan" ) )
110
- {
111
- return CascadeStyle . AllDeleteOrphan ;
112
- }
113
- else if ( cascade . Equals ( "none" ) )
114
- {
115
- return CascadeStyle . None ;
116
- }
117
- else if ( cascade . Equals ( "save-update" ) )
118
- {
119
- return CascadeStyle . Update ;
120
- }
121
- else if ( cascade . Equals ( "delete" ) )
122
- {
123
- return CascadeStyle . Delete ;
124
- }
125
- else if ( cascade . Equals ( "delete-orphan" ) )
126
- {
127
- return CascadeStyle . DeleteOrphan ;
128
- }
129
- else
109
+ string [ ] tokens = cascade . Split ( new char [ ] { ',' } ) ;
110
+ if ( tokens . Length == 0 ) return CascadeStyle . None ;
111
+ CascadeStyle [ ] styles = new CascadeStyle [ tokens . Length ] ;
112
+ int i = 0 ;
113
+ foreach ( string token in tokens )
130
114
{
131
- throw new MappingException ( "Unspported cascade style: " + cascade ) ;
115
+ styles [ i ++ ] = CascadeStyle . GetCascadeStyle ( token . ToLowerInvariant ( ) . Trim ( ) ) ;
132
116
}
117
+ if ( tokens . Length == 1 ) return styles [ 0 ] ;
118
+ else return new CascadeStyle . MultipleCascadeStyle ( styles ) ;
133
119
}
134
120
}
135
121
}
0 commit comments