1 | log.info( "Reading mappings from resource: " + resourceName );↵ | | |
|
2 | InputStream rsrc = classLoader.getResourceAsStream( resourceNam↵ | | 1 | try {↵
|
3 | e );↵ | | 2 | QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role );↵
|
4 | if ( rsrc == null ) {↵ | | 3 | if ( ↵
|
5 | throw new MappingNotFoundException( "resource", resourceName );↵ | | |
|
6 | }↵ | | |
|
7 | try {↵ | | |
|
8 | return addInputStream( rsrc↵ | | 4 | queryableCollection != null ) {↵
|
| | | 5 | collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) );↵
|
| | | 6 | }↵
|
| | | 7 | return queryableCollection;↵
|
| | | 8 | }↵
|
| | | 9 | catch ( ClassCastException cce ) {↵
|
9 | );↵ | | 10 | throw new QueryException( "collection role is not queryable: " + role );↵
|
10 | }↵ | | 11 | }↵
|
11 | catch (MappingException me) {↵ | | 12 | catch ( Exception e ) {↵
|
12 | throw new InvalidMappingException( "resource", resourceName, me );↵ | | 13 | throw new QueryException( "collection role not found: " + role );↵
|
13 | } | | 14 | }
|