@Override public String objectToSQLString(Boolean value, Dialect dialect) { return dialect.toBooleanValueString( value ); } }
token = dialect.toBooleanValueString( Boolean.parseBoolean( token ) );
@Override @SuppressWarnings( {"unchecked"}) public String getRenderText(SessionFactoryImplementor sessionFactory) { final boolean literalValue = getValue(); if ( expectedType instanceof AttributeConverterTypeAdapter ) { return determineConvertedValue( (AttributeConverterTypeAdapter) expectedType, literalValue ); } else if ( expectedType instanceof LiteralType ) { try { return ( (LiteralType) expectedType ).objectToSQLString( getValue(), sessionFactory.getDialect() ); } catch( Exception t ) { throw new QueryException( "Unable to render boolean literal value using expected LiteralType", t ); } } return sessionFactory.getDialect().toBooleanValueString( literalValue ); } }
@Override public void configure(Configuration cfg) { super.configure( cfg ); if ( !useAntlrParser ) { cfg.setProperty( Environment.QUERY_TRANSLATOR, ClassicQueryTranslatorFactory.class.getName() ); try { String dialectTrueRepresentation = Dialect.getDialect().toBooleanValueString( true ); // if this call succeeds, then the dialect is saying to represent true/false as int values... Integer.parseInt( dialectTrueRepresentation ); String subs = cfg.getProperties().getProperty( Environment.QUERY_SUBSTITUTIONS ); if ( subs == null ) { subs = ""; } if ( StringHelper.isEmpty( subs ) ) { subs = "true=1, false=0"; } else { subs += ", true=1, false=0"; } cfg.getProperties().setProperty( Environment.QUERY_SUBSTITUTIONS, subs ); // cfg.setNamingStrategy( DefaultNamingStrategy.INSTANCE ); } catch( NumberFormatException nfe ) { // the Integer#parseInt call failed... } } cfg.setProperty( AvailableSettings.JDBC_TYLE_PARAMS_ZERO_BASE, "true" ); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@Override public String toBooleanValueString(boolean bool) { return delegate.toBooleanValueString(bool); }
@SuppressWarnings({ "UnnecessaryUnboxing" }) public String objectToSQLString(Boolean value, Dialect dialect) { return dialect.toBooleanValueString( value.booleanValue() ); } }
@SuppressWarnings({ "UnnecessaryUnboxing" }) public String objectToSQLString(Boolean value, Dialect dialect) { return dialect.toBooleanValueString( value.booleanValue() ); } }
public void processBoolean(AST constant) { // TODO: something much better - look at the type of the other expression! // TODO: Have comparisonExpression and/or arithmeticExpression rules complete the resolution of boolean nodes. String replacement = ( String ) walker.getTokenReplacements().get( constant.getText() ); if ( replacement != null ) { constant.setText( replacement ); } else { boolean bool = "true".equals( constant.getText().toLowerCase() ); Dialect dialect = walker.getSessionFactoryHelper().getFactory().getDialect(); constant.setText( dialect.toBooleanValueString(bool) ); } }
public void processBoolean(AST constant) { // TODO: something much better - look at the type of the other expression! // TODO: Have comparisonExpression and/or arithmeticExpression rules complete the resolution of boolean nodes. String replacement = ( String ) walker.getTokenReplacements().get( constant.getText() ); if ( replacement != null ) { constant.setText( replacement ); } else { boolean bool = "true".equals( constant.getText().toLowerCase() ); Dialect dialect = walker.getSessionFactoryHelper().getFactory().getDialect(); constant.setText( dialect.toBooleanValueString(bool) ); } }
public void processBoolean(AST constant) { // TODO: something much better - look at the type of the other expression! // TODO: Have comparisonExpression and/or arithmeticExpression rules complete the resolution of boolean nodes. String replacement = ( String ) walker.getTokenReplacements().get( constant.getText() ); if ( replacement != null ) { constant.setText( replacement ); } else { boolean bool = "true".equals( constant.getText().toLowerCase() ); Dialect dialect = walker.getSessionFactoryHelper().getFactory().getDialect(); constant.setText( dialect.toBooleanValueString(bool) ); } }