private Type getNakedPropertyType(FromElement fromElement) { if (fromElement == null) { return null; } String property = getOriginalText(); Type propertyType = null; try { propertyType = fromElement.getPropertyType(property, property); } catch (Throwable ignore) { } return propertyType; }
String propertyPath = String.join( ".", this.propertyPath, propertyName ); try { Type propertyType = getFromElement().getPropertyType( this.propertyPath, propertyPath ); return propertyType != null;
@Override public Type getDataType() { if ( super.getDataType() == null ) { FromElement fromElement = getLhs().getFromElement(); if ( fromElement == null ) { return null; } // If the lhs is a collection, use CollectionPropertyMapping Type propertyType = fromElement.getPropertyType( propertyPath, propertyPath ); LOG.debugf( "getDataType() : %s -> %s", propertyPath, propertyType ); super.setDataType( propertyType ); } return super.getDataType(); }
private boolean resolveAsNakedComponentPropertyRefRHS(DotNode parent) { FromElement fromElement = locateSingleFromElement(); if (fromElement == null) { return false; } Type propertyType; String propertyPath = parent.getLhs().getText() + "." + getText(); try { // check to see if our "propPath" actually // represents a property on the persister propertyType = fromElement.getPropertyType(getText(), propertyPath); } catch (Throwable t) { // assume we do *not* refer to a property on the given persister return false; } setFromElement(fromElement); // this piece is needed for usage in select clause super.setDataType(propertyType); nakedPropertyRef = true; return true; }
final String classAlias = origin.getClassAlias(); final String originTableAlias = origin.getTableAlias(); final Type propertyType = origin.getPropertyType( attributeName, attributeName );
private boolean resolveAsNakedComponentPropertyRefLHS(DotNode parent) { FromElement fromElement = locateSingleFromElement(); if (fromElement == null) { return false; } Type componentType = getNakedPropertyType(fromElement); if ( componentType == null ) { throw new QueryException( "Unable to resolve path [" + parent.getPath() + "], unexpected token [" + getOriginalText() + "]" ); } if (!componentType.isComponentType()) { throw new QueryException("Property '" + getOriginalText() + "' is not a component. Use an alias to reference associations or collections."); } Type propertyType; String propertyPath = getText() + "." + getNextSibling().getText(); try { // check to see if our "propPath" actually // represents a property on the persister propertyType = fromElement.getPropertyType(getText(), propertyPath); } catch (Throwable t) { // assume we do *not* refer to a property on the given persister return false; } setFromElement(fromElement); parent.setPropertyPath(propertyPath); parent.setDataType(propertyType); return true; }
private Type getNakedPropertyType(FromElement fromElement) { if (fromElement == null) { return null; } String property = getOriginalText(); Type propertyType = null; try { propertyType = fromElement.getPropertyType(property, property); } catch (Throwable t) { } return propertyType; }
private Type getNakedPropertyType(FromElement fromElement) { if (fromElement == null) { return null; } String property = getOriginalText(); Type propertyType = null; try { propertyType = fromElement.getPropertyType(property, property); } catch (Throwable t) { } return propertyType; }
@Override public Type getDataType() { if ( super.getDataType() == null ) { FromElement fromElement = getLhs().getFromElement(); if ( fromElement == null ) return null; // If the lhs is a collection, use CollectionPropertyMapping Type propertyType = fromElement.getPropertyType( propertyName, propertyPath ); LOG.debugf( "getDataType() : %s -> %s", propertyPath, propertyType ); super.setDataType( propertyType ); } return super.getDataType(); }
@Override public Type getDataType() { if ( super.getDataType() == null ) { FromElement fromElement = getLhs().getFromElement(); if ( fromElement == null ) return null; // If the lhs is a collection, use CollectionPropertyMapping Type propertyType = fromElement.getPropertyType( propertyName, propertyPath ); LOG.debugf( "getDataType() : %s -> %s", propertyPath, propertyType ); super.setDataType( propertyType ); } return super.getDataType(); }
private boolean resolveAsNakedComponentPropertyRefRHS(DotNode parent) { FromElement fromElement = locateSingleFromElement(); if (fromElement == null) { return false; } Type propertyType = null; String propertyPath = parent.getLhs().getText() + "." + getText(); try { // check to see if our "propPath" actually // represents a property on the persister propertyType = fromElement.getPropertyType(getText(), propertyPath); } catch (Throwable t) { // assume we do *not* refer to a property on the given persister return false; } setFromElement(fromElement); // this piece is needed for usage in select clause super.setDataType(propertyType); nakedPropertyRef = true; return true; }
private boolean resolveAsNakedComponentPropertyRefRHS(DotNode parent) { FromElement fromElement = locateSingleFromElement(); if (fromElement == null) { return false; } Type propertyType = null; String propertyPath = parent.getLhs().getText() + "." + getText(); try { // check to see if our "propPath" actually // represents a property on the persister propertyType = fromElement.getPropertyType(getText(), propertyPath); } catch (Throwable t) { // assume we do *not* refer to a property on the given persister return false; } setFromElement(fromElement); // this piece is needed for usage in select clause super.setDataType(propertyType); nakedPropertyRef = true; return true; }
setDataType( fromElement.getPropertyType( propertyName, propertyName ) ); selectColumns = fromElement.toColumns( fromElement.getTableAlias(), propertyName, inSelect );
setDataType( fromElement.getPropertyType( propertyName, propertyName ) ); selectColumns = fromElement.toColumns( fromElement.getTableAlias(), propertyName, inSelect );
private boolean resolveAsNakedComponentPropertyRefLHS(DotNode parent) { FromElement fromElement = locateSingleFromElement(); if (fromElement == null) { return false; } Type componentType = getNakedPropertyType(fromElement); if ( componentType == null ) { throw new QueryException( "Unable to resolve path [" + parent.getPath() + "], unexpected token [" + getOriginalText() + "]" ); } if (!componentType.isComponentType()) { throw new QueryException("Property '" + getOriginalText() + "' is not a component. Use an alias to reference associations or collections."); } Type propertyType = null; // used to set the type of the parent dot node String propertyPath = getText() + "." + getNextSibling().getText(); try { // check to see if our "propPath" actually // represents a property on the persister propertyType = fromElement.getPropertyType(getText(), propertyPath); } catch (Throwable t) { // assume we do *not* refer to a property on the given persister return false; } setFromElement(fromElement); parent.setPropertyPath(propertyPath); parent.setDataType(propertyType); return true; }
private boolean resolveAsNakedComponentPropertyRefLHS(DotNode parent) { FromElement fromElement = locateSingleFromElement(); if (fromElement == null) { return false; } Type componentType = getNakedPropertyType(fromElement); if ( componentType == null ) { throw new QueryException( "Unable to resolve path [" + parent.getPath() + "], unexpected token [" + getOriginalText() + "]" ); } if (!componentType.isComponentType()) { throw new QueryException("Property '" + getOriginalText() + "' is not a component. Use an alias to reference associations or collections."); } Type propertyType = null; // used to set the type of the parent dot node String propertyPath = getText() + "." + getNextSibling().getText(); try { // check to see if our "propPath" actually // represents a property on the persister propertyType = fromElement.getPropertyType(getText(), propertyPath); } catch (Throwable t) { // assume we do *not* refer to a property on the given persister return false; } setFromElement(fromElement); parent.setPropertyPath(propertyPath); parent.setDataType(propertyType); return true; }