.normalizeIdentifierQuoting( propertyresult.column() ); String key = StringHelper.root( name ); ArrayList<String> intermediateResults = propertyResultsTmp.get( key ); if ( intermediateResults == null ) {
static String getAlias(String path) { return StringHelper.root( path ); } }
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() ); } else { 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; }
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; }
String unalias(String path) { String alias = StringHelper.root( path ); String name = getAliasName( alias ); if ( name != null ) { return name + path.substring( alias.length() ); } else { return path; } }
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 ); } }
public String getEntityName(Criteria subcriteria, String propertyName) { if ( propertyName.indexOf( '.' ) > 0 ) { String root = StringHelper.root( propertyName ); Criteria crit = getAliasedCriteria( root ); if ( crit != null ) { return getEntityName( crit ); } } return getEntityName( subcriteria ); }
public String getEntityName(Criteria subcriteria, String propertyName) { if ( propertyName.indexOf('.')>0 ) { String root = StringHelper.root(propertyName); Criteria crit = getAliasedCriteria(root); if (crit!=null) return getEntityName(crit); } return getEntityName(subcriteria); }
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 ); }
private String getWholeAssociationPath(CriteriaImpl.Subcriteria subcriteria) { String path = subcriteria.getPath(); // some messy, complex stuff here, since createCriteria() can take an // aliased path, or a path rooted at the creating criteria instance Criteria parent = null; if ( path.indexOf('.')>0 ) { //if it is a compound path String testAlias = StringHelper.root(path); if ( !testAlias.equals( subcriteria.getAlias() ) ) { //and the qualifier is not the alias of this criteria parent = (Criteria) aliasCriteriaMap.get(testAlias); //check to see if we belong to some criteria other than the one that created us } } if (parent==null) { parent = subcriteria.getParent(); //otherwise assume the parent is the the criteria that created us } else { path = StringHelper.unroot(path); } if ( parent.equals(rootCriteria) ) { //if its the root criteria, we are done return path; } else { return getWholeAssociationPath( (CriteriaImpl.Subcriteria) parent ) + '.' + path; //otherwise, recurse } }
if ( path.indexOf( '.' ) > 0 ) { String testAlias = StringHelper.root( path ); if ( !testAlias.equals( subcriteria.getAlias() ) ) {
private Property getRecursiveProperty(String propertyPath, Iterator iter) throws MappingException { Property property = null; StringTokenizer st = new StringTokenizer( propertyPath, ".", false); try { while ( st.hasMoreElements() ) { String element = (String) st.nextElement(); if (property == null) { Property identifierProperty = getIdentifierProperty(); if ( identifierProperty != null && identifierProperty.getName().equals( StringHelper.root(element) ) ) { property = identifierProperty; } else { property = getProperty( element, iter ); } } else { //flat recursive algorithm property = ( (Component) property.getValue() ).getProperty(element); } } } catch (MappingException e) { throw new MappingException( "property not found: " + propertyPath + "in entity: " + getEntityName(), e ); } return property; }
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() ); pathExpressionParser.addAssociation( q ); } else if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) { //named query parameter q.addNamedParameter( token.substring( 1 ) ); q.appendOrderByToken( "?" ); } else { q.appendOrderByToken( token ); } }
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() ); pathExpressionParser.addAssociation( q ); } else if ( token.startsWith( ParserHelper.HQL_VARIABLE_PREFIX ) ) { //named query parameter q.addNamedParameter( token.substring( 1 ) ); q.appendOrderByToken( "?" ); } else { q.appendOrderByToken( token ); } }
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 ); } }
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 ); } }
/** * Warning: * When there are duplicated property names in the subclasses * of the class, this method may return the wrong table * number for the duplicated subclass property (note that * SingleTableEntityPersister defines an overloaded form * which takes the entity name. */ protected int getSubclassPropertyTableNumber(String propertyName) { final String rootPropertyName = StringHelper.root(propertyName); Type type = propertyMapping.toType(rootPropertyName); if ( type.isAssociationType() && ( (AssociationType) type ).useLHSPrimaryKey() ) { return 0; } if ( type.isComponentType() && !propertyName.equals(rootPropertyName) ) { String unrooted = StringHelper.unroot(propertyName); int idx = ArrayHelper.indexOf( getSubclassColumnClosure(), unrooted ); if ( idx != -1 ) { return getSubclassColumnTableNumberClosure()[idx]; } } int index = ArrayHelper.indexOf( getSubclassPropertyNameClosure(), rootPropertyName); //TODO: optimize this better! return index==-1 ? 0 : getSubclassPropertyTableNumber(index); }