Tabnine Logo
Template
Code IndexAdd Tabnine to your IDE (free)

How to use
Template
in
org.hibernate.sql

Best Java code snippets using org.hibernate.sql.Template (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

  final String field = extractUntil( tokens, "from" );
  final String source = renderWhereStringTemplate(
      extractUntil( tokens, ")" ),
      placeholder,
      dialect,
          renderWhereStringTemplate( trimOperands.trimSpec, placeholder, dialect, functionRegistry )
      );
  result.append( renderWhereStringTemplate( trimOperands.trimSource, placeholder, dialect, functionRegistry ) )
      .append( ')' );
else if ( isNamedParameter(token) ) {
  result.append(token);
else if ( isIdentifier(token)
    && !isFunctionOrKeyword(lcToken, nextToken, dialect , functionRegistry) ) {
  result.append(placeholder)
      .append('.')
    beforeTable = true;
  if ( isBoolean( token ) ) {
    token = dialect.toBooleanValueString( Boolean.parseBoolean( token ) );
origin: hibernate/hibernate-orm

/**
 * Performs order-by template rendering without {@link ColumnMapper column mapping}.  An <tt>ORDER BY</tt> template
 * has all column references "qualified" with a placeholder identified by {@link Template#TEMPLATE}
 *
 * @param orderByFragment The order-by fragment to render.
 * @param dialect The SQL dialect being used.
 * @param functionRegistry The SQL function registry
 *
 * @return The rendered <tt>ORDER BY</tt> template.
 *
 * @deprecated Use {@link #translateOrderBy} instead
 */
@Deprecated
public static String renderOrderByStringTemplate(
    String orderByFragment,
    Dialect dialect,
    SQLFunctionRegistry functionRegistry) {
  return renderOrderByStringTemplate(
      orderByFragment,
      NoOpColumnMapper.INSTANCE,
      null,
      dialect,
      functionRegistry
  );
}
origin: hibernate/hibernate-orm

private static boolean isFunctionOrKeyword(
    String lcToken,
    String nextToken,
    Dialect dialect,
    SQLFunctionRegistry functionRegistry) {
  return "(".equals( nextToken ) ||
      KEYWORDS.contains( lcToken ) ||
      isType( lcToken, dialect ) ||
      isFunction( lcToken, nextToken, functionRegistry ) ||
      dialect.getKeywords().contains( lcToken ) ||
      FUNCTION_KEYWORDS.contains( lcToken );
}
origin: hibernate/hibernate-orm

public static String renderWhereStringTemplate(String sqlWhereString, Dialect dialect, SQLFunctionRegistry functionRegistry) {
  return renderWhereStringTemplate(sqlWhereString, TEMPLATE, dialect, functionRegistry);
}
origin: hibernate/hibernate

hasOrder = sqlOrderByString != null;
sqlOrderByStringTemplate = hasOrder ?
    Template.renderOrderByStringTemplate(sqlOrderByString, dialect) :
    null;
sqlWhereString = collection.getWhere();
hasWhere = sqlWhereString != null;
sqlWhereStringTemplate = hasWhere ?
    Template.renderWhereStringTemplate(sqlWhereString, dialect) :
    null;
manyToManyWhereTemplate = manyToManyWhereString == null ?
    null :
    Template.renderWhereStringTemplate( manyToManyWhereString, factory.getDialect() );
origin: hibernate/hibernate

  result.append(token);
else if ( isNamedParameter(token) ) {
  result.append(token);
  isIdentifier(token, dialect) &&
  !isFunction(lcToken, nextToken, dialect)
) {
  result.append(placeholder)
origin: hibernate/hibernate-orm

hasWhere = sqlWhereString != null;
sqlWhereStringTemplate = hasWhere ?
    Template.renderWhereStringTemplate( sqlWhereString, dialect, factory.getSqlFunctionRegistry() ) :
    null;
if ( hasOrder ) {
  LOG.debugf( "Translating order-by fragment [%s] for collection role : %s",  collectionBinding.getOrderBy(), getRole() );
  orderByTranslation = Template.translateOrderBy(
      collectionBinding.getOrderBy(),
      new ColumnMapperImpl(),
manyToManyWhereTemplate = manyToManyWhereString == null ?
    null :
    Template.renderWhereStringTemplate( manyToManyWhereString, factory.getDialect(), factory.getSqlFunctionRegistry() );
  manyToManyOrderByTranslation = Template.translateOrderBy(
      collectionBinding.getManyToManyOrdering(),
      new ColumnMapperImpl(),
origin: org.hibernate/com.springsource.org.hibernate

private static boolean isFunctionOrKeyword(String lcToken, String nextToken, Dialect dialect, SQLFunctionRegistry functionRegistry) {
  return "(".equals(nextToken) ||
    KEYWORDS.contains(lcToken) ||
    isFunction(lcToken, nextToken, functionRegistry ) ||
    dialect.getKeywords().contains(lcToken) ||
    FUNCTION_KEYWORDS.contains(lcToken);
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

  result.append(token);
else if ( isNamedParameter(token) ) {
  result.append(token);
origin: hibernate/hibernate-orm

/**
 * Same functionality as {@link #renderWhereStringTemplate(String, String, Dialect, SQLFunctionRegistry)},
 * except that a SQLFunctionRegistry is not provided (i.e., only the dialect-defined functions are
 * considered).  This is only intended for use by the annotations project until the
 * many-to-many/map-key-from-target-table feature is pulled into core.
 *
 * @deprecated Only intended for annotations usage; use {@link #renderWhereStringTemplate(String, String, Dialect, SQLFunctionRegistry)} instead
 */
@Deprecated
@SuppressWarnings({ "JavaDoc" })
public static String renderWhereStringTemplate(String sqlWhereString, String placeholder, Dialect dialect) {
  return renderWhereStringTemplate(
      sqlWhereString,
      placeholder,
      dialect,
      new SQLFunctionRegistry( dialect, java.util.Collections.<String, SQLFunction>emptyMap() )
  );
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

hasOrder = sqlOrderByString != null;
sqlOrderByStringTemplate = hasOrder ?
    Template.renderOrderByStringTemplate(sqlOrderByString, dialect, factory.getSqlFunctionRegistry()) :
    null;
sqlWhereString = StringHelper.isNotEmpty( collection.getWhere() ) ? "( " + collection.getWhere() + ") " : null;
hasWhere = sqlWhereString != null;
sqlWhereStringTemplate = hasWhere ?
    Template.renderWhereStringTemplate(sqlWhereString, dialect, factory.getSqlFunctionRegistry()) :
    null;
origin: org.hibernate/com.springsource.org.hibernate.core

private static boolean isFunctionOrKeyword(String lcToken, String nextToken, Dialect dialect, SQLFunctionRegistry functionRegistry) {
  return "(".equals(nextToken) ||
    KEYWORDS.contains(lcToken) ||
    isFunction(lcToken, nextToken, functionRegistry ) ||
    dialect.getKeywords().contains(lcToken) ||
    FUNCTION_KEYWORDS.contains(lcToken);
}
origin: org.hibernate/com.springsource.org.hibernate.core

  final String field = extractUntil( tokens, "from" );
  final String source = renderWhereStringTemplate(
      extractUntil( tokens, ")" ),
      placeholder,
      dialect,
          renderWhereStringTemplate( trimOperands.trimSpec, placeholder, dialect, functionRegistry )
      );
  result.append( renderWhereStringTemplate( trimOperands.trimSource, placeholder, dialect, functionRegistry ) )
      .append( ')' );
else if ( isNamedParameter(token) ) {
  result.append(token);
else if ( isIdentifier(token, dialect)
    && !isFunctionOrKeyword(lcToken, nextToken, dialect , functionRegistry) ) {
  result.append(placeholder)
      .append('.')
origin: hibernate/hibernate-orm

protected static String getTemplateFromString(String string, SessionFactoryImplementor factory) {
  return string == null ?
      null :
      Template.renderWhereStringTemplate( string, factory.getDialect(), factory.getSqlFunctionRegistry() );
}
origin: org.hibernate/com.springsource.org.hibernate

hasWhere = sqlWhereString != null;
sqlWhereStringTemplate = hasWhere ?
    Template.renderWhereStringTemplate( sqlWhereString, dialect, factory.getSqlFunctionRegistry() ) :
    null;
  sqlOrderByStringTemplate = Template.renderOrderByStringTemplate(
      collection.getOrderBy(),
      mapper,
manyToManyWhereTemplate = manyToManyWhereString == null ?
    null :
    Template.renderWhereStringTemplate( manyToManyWhereString, factory.getDialect(), factory.getSqlFunctionRegistry() );
  manyToManyOrderByTemplate = Template.renderOrderByStringTemplate(
      collection.getManyToManyOrdering(),
      mapper,
origin: hibernate/hibernate-orm

  public String doStandardRendering(String fragment) {
    return Template.renderOrderByStringTemplate( fragment, MAPPER, SESSION_FACTORY, DIALECT, FUNCTION_REGISTRY );
  }
}
origin: org.hibernate.orm/hibernate-core

private static boolean isFunctionOrKeyword(
    String lcToken,
    String nextToken,
    Dialect dialect,
    SqmFunctionRegistry functionRegistry) {
  return "(".equals( nextToken ) ||
      KEYWORDS.contains( lcToken ) ||
      isType( lcToken, dialect ) ||
      isFunction( lcToken, nextToken, functionRegistry ) ||
      dialect.getKeywords().contains( lcToken ) ||
      FUNCTION_KEYWORDS.contains( lcToken );
}
origin: org.hibernate/com.springsource.org.hibernate

  final String field = extractUntil( tokens, "from" );
  final String source = renderWhereStringTemplate(
      extractUntil( tokens, ")" ),
      placeholder,
      dialect,
          renderWhereStringTemplate( trimOperands.trimSpec, placeholder, dialect, functionRegistry )
      );
  result.append( renderWhereStringTemplate( trimOperands.trimSource, placeholder, dialect, functionRegistry ) )
      .append( ')' );
else if ( isNamedParameter(token) ) {
  result.append(token);
else if ( isIdentifier(token, dialect)
    && !isFunctionOrKeyword(lcToken, nextToken, dialect , functionRegistry) ) {
  result.append(placeholder)
      .append('.')
origin: hibernate/hibernate-orm

@Override
public String getTemplate(Dialect dialect, SQLFunctionRegistry functionRegistry) {
  String template = Template.renderWhereStringTemplate(formula, dialect, functionRegistry);
  return safeInterning( StringHelper.replace( template, "{alias}", Template.TEMPLATE ) );
}
origin: org.hibernate/com.springsource.org.hibernate.core

hasWhere = sqlWhereString != null;
sqlWhereStringTemplate = hasWhere ?
    Template.renderWhereStringTemplate( sqlWhereString, dialect, factory.getSqlFunctionRegistry() ) :
    null;
  sqlOrderByStringTemplate = Template.renderOrderByStringTemplate(
      collection.getOrderBy(),
      mapper,
manyToManyWhereTemplate = manyToManyWhereString == null ?
    null :
    Template.renderWhereStringTemplate( manyToManyWhereString, factory.getDialect(), factory.getSqlFunctionRegistry() );
  manyToManyOrderByTemplate = Template.renderOrderByStringTemplate(
      collection.getManyToManyOrdering(),
      mapper,
org.hibernate.sqlTemplate

Javadoc

Parses SQL fragments specified in mapping documents

Most used methods

  • renderWhereStringTemplate
  • isNamedParameter
  • renderOrderByStringTemplate
    Performs order-by template rendering allowing ColumnMapper. An ORDER BY template has all column refe
  • isFunction
  • isIdentifier
  • extractUntil
  • isFunctionOrKeyword
  • isBoolean
  • isType
  • renderTransformerReadFragment
  • translateOrderBy
    Performs order-by template rendering allowing ColumnMapper. An ORDER BY template has all column refe
  • translateOrderBy

Popular in Java

  • Reading from database using SQL prepared statement
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • findViewById (Activity)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JLabel (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now