private static NativeSQLQueryRootReturn bindReturn(Element returnElem, Mappings mappings, int elementCount) { String alias = returnElem.attributeValue( "alias" ); if( StringHelper.isEmpty(alias)) { alias = "alias_" + elementCount; // hack/workaround as sqlquery impl depend on having a key. } String entityName = HbmBinder.getEntityName(returnElem, mappings); if(entityName==null) { throw new MappingException( "<return alias='" + alias + "'> must specify either a class or entity-name"); } LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) ); PersistentClass pc = mappings.getClass( entityName ); java.util.Map propertyResults = bindPropertyResults(alias, returnElem, pc, mappings ); return new NativeSQLQueryRootReturn( alias, entityName, propertyResults, lockMode ); }
private static NativeSQLQueryJoinReturn bindReturnJoin(Element returnElem, Mappings mappings) { String alias = returnElem.attributeValue( "alias" ); String roleAttribute = returnElem.attributeValue( "property" ); LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) ); int dot = roleAttribute.lastIndexOf( '.' ); if ( dot == -1 ) { throw new MappingException( "Role attribute for sql query return [alias=" + alias + "] not formatted correctly {owningAlias.propertyName}" ); } String roleOwnerAlias = roleAttribute.substring( 0, dot ); String roleProperty = roleAttribute.substring( dot + 1 ); //FIXME: get the PersistentClass java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings ); return new NativeSQLQueryJoinReturn( alias, roleOwnerAlias, roleProperty, propertyResults, // TODO: bindpropertyresults(alias, returnElem) lockMode ); }
private static NativeSQLQueryJoinReturn bindReturnJoin(Element returnElem, Mappings mappings) { String alias = returnElem.attributeValue( "alias" ); String roleAttribute = returnElem.attributeValue( "property" ); LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) ); int dot = roleAttribute.lastIndexOf( '.' ); if ( dot == -1 ) { throw new MappingException( "Role attribute for sql query return [alias=" + alias + "] not formatted correctly {owningAlias.propertyName}" ); } String roleOwnerAlias = roleAttribute.substring( 0, dot ); String roleProperty = roleAttribute.substring( dot + 1 ); //FIXME: get the PersistentClass java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings ); return new NativeSQLQueryJoinReturn( alias, roleOwnerAlias, roleProperty, propertyResults, // TODO: bindpropertyresults(alias, returnElem) lockMode ); }
private static NativeSQLQueryCollectionReturn bindLoadCollection(Element returnElem, Mappings mappings) { String alias = returnElem.attributeValue( "alias" ); String collectionAttribute = returnElem.attributeValue( "role" ); LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) ); int dot = collectionAttribute.lastIndexOf( '.' ); if ( dot == -1 ) { throw new MappingException( "Collection attribute for sql query return [alias=" + alias + "] not formatted correctly {OwnerClassName.propertyName}" ); } String ownerClassName = HbmBinder.getClassName( collectionAttribute.substring( 0, dot ), mappings ); String ownerPropertyName = collectionAttribute.substring( dot + 1 ); //FIXME: get the PersistentClass java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings ); return new NativeSQLQueryCollectionReturn( alias, ownerClassName, ownerPropertyName, propertyResults, lockMode ); }
private static NativeSQLQueryCollectionReturn bindLoadCollection(Element returnElem, Mappings mappings) { String alias = returnElem.attributeValue( "alias" ); String collectionAttribute = returnElem.attributeValue( "role" ); LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) ); int dot = collectionAttribute.lastIndexOf( '.' ); if ( dot == -1 ) { throw new MappingException( "Collection attribute for sql query return [alias=" + alias + "] not formatted correctly {OwnerClassName.propertyName}" ); } String ownerClassName = HbmBinder.getClassName( collectionAttribute.substring( 0, dot ), mappings ); String ownerPropertyName = collectionAttribute.substring( dot + 1 ); //FIXME: get the PersistentClass java.util.Map propertyResults = bindPropertyResults(alias, returnElem, null, mappings ); return new NativeSQLQueryCollectionReturn( alias, ownerClassName, ownerPropertyName, propertyResults, lockMode ); }
private static NativeSQLQueryRootReturn bindReturn(Element returnElem, Mappings mappings, int elementCount) { String alias = returnElem.attributeValue( "alias" ); if( StringHelper.isEmpty( alias )) { alias = "alias_" + elementCount; // hack/workaround as sqlquery impl depend on having a key. } String entityName = HbmBinder.getEntityName(returnElem, mappings); if(entityName==null) { throw new MappingException( "<return alias='" + alias + "'> must specify either a class or entity-name"); } LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) ); PersistentClass pc = mappings.getClass( entityName ); java.util.Map propertyResults = bindPropertyResults(alias, returnElem, pc, mappings ); return new NativeSQLQueryRootReturn( alias, entityName, propertyResults, lockMode ); }
private static NativeSQLQueryRootReturn bindReturn(Element returnElem, Mappings mappings, int elementCount) { String alias = returnElem.attributeValue( "alias" ); if( StringHelper.isEmpty( alias )) { alias = "alias_" + elementCount; // hack/workaround as sqlquery impl depend on having a key. } String entityName = HbmBinder.getEntityName(returnElem, mappings); if(entityName==null) { throw new MappingException( "<return alias='" + alias + "'> must specify either a class or entity-name"); } LockMode lockMode = getLockMode( returnElem.attributeValue( "lock-mode" ) ); PersistentClass pc = mappings.getClass( entityName ); java.util.Map propertyResults = bindPropertyResults(alias, returnElem, pc, mappings ); return new NativeSQLQueryRootReturn( alias, entityName, propertyResults, lockMode ); }