public static String getAlias(String path) { return StringHelper.root( path ); } }
String unalias(String path) { String alias = StringHelper.root( path ); String name = getAliasName( alias ); if ( name != null ) { return name + path.substring( alias.length() ); } return path; }
@Override public String getPropertyName(String propertyName) { if ( propertyName.indexOf( '.' ) > 0 ) { final String root = StringHelper.root( propertyName ); final Criteria criteria = getAliasedCriteria( root ); if ( criteria != null ) { return propertyName.substring( root.length() + 1 ); } } return propertyName; }
private Property getProperty(String propertyName, Iterator iterator) throws MappingException { if ( iterator.hasNext() ) { String root = StringHelper.root( propertyName ); while ( iterator.hasNext() ) { Property prop = (Property) iterator.next(); if ( prop.getName().equals( root ) ) { return prop; } } } throw new MappingException( "property [" + propertyName + "] not found on entity [" + getEntityName() + "]" ); }
@Override public String getEntityName(Criteria subcriteria, String propertyName) { if ( propertyName.indexOf( '.' ) > 0 ) { final String root = StringHelper.root( propertyName ); final Criteria crit = getAliasedCriteria( root ); if ( crit != null ) { return getEntityName( crit ); } } return getEntityName( subcriteria ); }
@Override public String getSQLAlias(Criteria criteria, String propertyName) { if ( propertyName.indexOf( '.' ) > 0 ) { final String root = StringHelper.root( propertyName ); final Criteria subcriteria = getAliasedCriteria( root ); if ( subcriteria != null ) { return getSQLAlias( subcriteria ); } } return getSQLAlias( criteria ); }
public Property getProperty(String propertyName) throws MappingException { Iterator iter = getPropertyClosureIterator(); Property identifierProperty = getIdentifierProperty(); if ( identifierProperty != null && identifierProperty.getName().equals( StringHelper.root( propertyName ) ) ) { return identifierProperty; } else { return getProperty( propertyName, iter ); } }
if ( path.indexOf( '.' ) > 0 ) { String testAlias = StringHelper.root( path ); if ( !testAlias.equals( subcriteria.getAlias() ) ) {
public void token(String token, QueryTranslatorImpl q) throws QueryException { if ( q.isName( StringHelper.root( token ) ) ) { ParserHelper.parse( pathExpressionParser, q.unalias( token ), ParserHelper.PATH_SEPARATORS, q ); q.appendOrderByToken( pathExpressionParser.getWhereColumn() );
public void token(String token, QueryTranslatorImpl q) throws QueryException { if ( q.isName( StringHelper.root( token ) ) ) { ParserHelper.parse( pathExpressionParser, q.unalias( token ), ParserHelper.PATH_SEPARATORS, q ); q.appendGroupByToken( pathExpressionParser.getWhereColumn() ); pathExpressionParser.addAssociation( q ); } else { q.appendGroupByToken( token ); } }
private void doToken(String token, QueryTranslatorImpl q) throws QueryException { if ( q.isName( StringHelper.root( token ) ) ) {
String key = StringHelper.root( name ); ArrayList<String> intermediateResults = propertyResultsTmp.get( key ); if ( intermediateResults == null ) {
String rootPropertyName = StringHelper.root( propertyPath ); Type type = propertyMapping.toType( rootPropertyName ); if ( type.isAssociationType() ) {
String pathRoot = StringHelper.root( path ); FromElement origin = fromClause.getFromElement( pathRoot ); if ( origin == null || origin.getFromClause() != fromClause ) {
String unalias(String path) { String alias = StringHelper.root( path ); String name = getAliasName( alias ); if (name != null) return name + path.substring(alias.length()); return path; }
public String getPropertyName(String propertyName) { if ( propertyName.indexOf( '.' ) > 0 ) { String root = StringHelper.root( propertyName ); Criteria crit = getAliasedCriteria( root ); if ( crit != null ) { return propertyName.substring( root.length() + 1 ); } } return propertyName; }
private Property getProperty(String propertyName, Iterator iterator) throws MappingException { if ( iterator.hasNext() ) { String root = StringHelper.root( propertyName ); while ( iterator.hasNext() ) { Property prop = (Property) iterator.next(); if ( prop.getName().equals( root ) ) { return prop; } } } throw new MappingException( "property [" + propertyName + "] not found on entity [" + getEntityName() + "]" ); }
public String getSQLAlias(Criteria criteria, String propertyName) { if ( propertyName.indexOf( '.' ) > 0 ) { String root = StringHelper.root( propertyName ); Criteria subcriteria = getAliasedCriteria( root ); if ( subcriteria != null ) { return getSQLAlias( subcriteria ); } } return getSQLAlias( criteria ); }
public String getSQLAlias(Criteria criteria, String propertyName) { if ( propertyName.indexOf( '.' ) > 0 ) { String root = StringHelper.root( propertyName ); Criteria subcriteria = getAliasedCriteria( root ); if ( subcriteria != null ) { return getSQLAlias( subcriteria ); } } return getSQLAlias( criteria ); }
public Property getProperty(String propertyName) throws MappingException { Iterator iter = getPropertyClosureIterator(); Property identifierProperty = getIdentifierProperty(); if ( identifierProperty != null && identifierProperty.getName().equals( StringHelper.root(propertyName) ) ) { return identifierProperty; } else { return getProperty( propertyName, iter ); } }