org.hibernate.query.criteria.LiteralHandlingMode源码实例Demo

类org.hibernate.query.criteria.LiteralHandlingMode源码实例Demo

下面列出了org.hibernate.query.criteria.LiteralHandlingMode 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: LiteralExpression.java
@SuppressWarnings({ "unchecked" })
public String render(RenderingContext renderingContext) {

	LiteralHandlingMode literalHandlingMode = renderingContext.getCriteriaLiteralHandlingMode();

	switch ( literalHandlingMode ) {
		case AUTO:
			if ( ValueHandlerFactory.isNumeric( literal ) ) {
				return ValueHandlerFactory.determineAppropriateHandler( (Class) literal.getClass() ).render( literal );
			}
			else {
				return bindLiteral( renderingContext );
			}
		case BIND:
			return bindLiteral( renderingContext );
		case INLINE:
			Object literalValue = literal;
			if ( String.class.equals( literal.getClass() ) ) {
				literalValue = renderingContext.getDialect().inlineLiteral( (String) literal );
			}
			return ValueHandlerFactory.determineAppropriateHandler( (Class) literal.getClass() ).render( literalValue );
		default:
			throw new IllegalArgumentException( "Unexpected LiteralHandlingMode: " + literalHandlingMode );
	}
}
 
@Override
	public LiteralHandlingMode getCriteriaLiteralHandlingMode() {
		return LiteralHandlingMode.INLINE;
//				return criteriaLiteralHandlingMode;
	}
 
@Override
public LiteralHandlingMode getCriteriaLiteralHandlingMode() {
	return delegate.getCriteriaLiteralHandlingMode();
}
 
源代码4 项目: lams   文件: SessionFactoryOptions.java
default LiteralHandlingMode getCriteriaLiteralHandlingMode() {
	return LiteralHandlingMode.AUTO;
}
 
源代码5 项目: lams   文件: SessionFactoryOptionsBuilder.java
@Override
public LiteralHandlingMode getCriteriaLiteralHandlingMode() {
	return this.criteriaLiteralHandlingMode;
}
 
@Override
protected void additionalProperties(Properties properties) {
    properties.put(AvailableSettings.CRITERIA_LITERAL_HANDLING_MODE, LiteralHandlingMode.INLINE);
}
 
@Override
protected void additionalProperties(Properties properties) {
    properties.put(AvailableSettings.CRITERIA_LITERAL_HANDLING_MODE, LiteralHandlingMode.BIND);
}
 
源代码8 项目: lams   文件: RenderingContext.java
/**
 * How literals are going to be handled.
 *
 * @return literal handling strategy
 */
default LiteralHandlingMode getCriteriaLiteralHandlingMode() {
	return LiteralHandlingMode.AUTO;
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 类方法
 同包方法