private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
/** * Locate the collection persister by the collection role, requiring that * such a persister exist. * * @param role The collection role name. * * @return The defined CollectionPersister for this collection role. * * @throws QueryException Indicates that the collection persister could not be found. */ public QueryableCollection requireQueryableCollection(String role) throws QueryException { try { QueryableCollection queryableCollection = (QueryableCollection) sfi.getMetamodel().collectionPersister( role ); if ( queryableCollection != null ) { collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) ); } return queryableCollection; } catch ( ClassCastException cce ) { throw new QueryException( "collection role is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection role not found: " + role ); } }
this.collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection );
collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection );
currentPropertyMapping = new CollectionPropertyMapping( collectionPersister ); return elementName;
QueryableCollection requireQueryableCollection(String role) { try { QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role ); if ( queryableCollection != null ) { collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) ); } return queryableCollection; } catch ( ClassCastException cce ) { throw new QueryException( "collection role is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection role not found: " + role ); } }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
/** * Locate the collection persister by the collection role, requiring that * such a persister exist. * * @param role The collection role name. * @return The defined CollectionPersister for this collection role. * @throws QueryException Indicates that the collection persister could not be found. */ public QueryableCollection requireQueryableCollection(String role) throws QueryException { try { QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role ); if ( queryableCollection != null ) { collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) ); } return queryableCollection; } catch ( ClassCastException cce ) { throw new QueryException( "collection role is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection role not found: " + role ); } }
/** * Locate the collection persister by the collection role, requiring that * such a persister exist. * * @param role The collection role name. * @return The defined CollectionPersister for this collection role. * @throws QueryException Indicates that the collection persister could not be found. */ public QueryableCollection requireQueryableCollection(String role) throws QueryException { try { QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role ); if ( queryableCollection != null ) { collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) ); } return queryableCollection; } catch ( ClassCastException cce ) { throw new QueryException( "collection role is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection role not found: " + role ); } }
/** * Locate the collection persister by the collection role, requiring that * such a persister exist. * * @param role The collection role name. * @return The defined CollectionPersister for this collection role. * @throws QueryException Indicates that the collection persister could not be found. */ public QueryableCollection requireQueryableCollection(String role) throws QueryException { try { QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role ); if ( queryableCollection != null ) { collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) ); } return queryableCollection; } catch ( ClassCastException cce ) { throw new QueryException( "collection role is not queryable: " + role ); } catch ( Exception e ) { throw new QueryException( "collection role not found: " + role ); } }
PropertyMapping getPropertyMapping(String propertyName) { checkInitialized(); if ( queryableCollection == null ) { // Not a collection? return ( PropertyMapping ) persister; // Return the entity property mapping. } // If the property is a special collection property name, return a CollectionPropertyMapping. if ( CollectionProperties.isCollectionProperty( propertyName ) ) { if ( collectionPropertyMapping == null ) { collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection ); } return collectionPropertyMapping; } if ( queryableCollection.getElementType().isComponentType() ) { // Collection of components. if ( propertyName.equals( EntityPersister.ENTITY_ID ) ) { return ( PropertyMapping ) queryableCollection.getOwnerEntityPersister(); } } return queryableCollection; }
PropertyMapping getPropertyMapping(String propertyName) { checkInitialized(); if ( queryableCollection == null ) { // Not a collection? return ( PropertyMapping ) persister; // Return the entity property mapping. } // If the property is a special collection property name, return a CollectionPropertyMapping. if ( CollectionProperties.isCollectionProperty( propertyName ) ) { if ( collectionPropertyMapping == null ) { collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection ); } return collectionPropertyMapping; } if ( queryableCollection.getElementType().isAnyType() ) { // collection of <many-to-any/> mappings... // used to circumvent the component-collection check below... return queryableCollection; } if ( queryableCollection.getElementType().isComponentType() ) { // Collection of components. if ( propertyName.equals( EntityPersister.ENTITY_ID ) ) { return ( PropertyMapping ) queryableCollection.getOwnerEntityPersister(); } } return queryableCollection; }
collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection );
collectionPropertyMapping = new CollectionPropertyMapping( queryableCollection );
currentPropertyMapping = new CollectionPropertyMapping( collectionPersister ); return elementName;
currentPropertyMapping = new CollectionPropertyMapping( collectionPersister ); return elementName;
currentPropertyMapping = new CollectionPropertyMapping( collectionPersister ); return elementName;