@Override public boolean isMatch(Dialect dialect) { return '\"' == dialect.openQuote() && '\"' == dialect.closeQuote(); } }
/** * Determine if the given name is quoted. It is considered quoted if either: * <ol> * <li>starts AND ends with backticks (`)</li> * <li>starts with dialect-specified {@link org.hibernate.dialect.Dialect#openQuote() open-quote} * AND ends with dialect-specified {@link org.hibernate.dialect.Dialect#closeQuote() close-quote}</li> * </ol> * * @param name The name to check * @param dialect The dialect (to determine the "real" quoting chars). * * @return True if quoted, false otherwise */ public static boolean isQuoted(String name, Dialect dialect) { return name != null && name.length() != 0 && ( ( name.charAt( 0 ) == '`' && name.charAt( name.length() - 1 ) == '`' ) || ( name.charAt( 0 ) == '"' && name.charAt( name.length() - 1 ) == '"' ) || ( name.charAt( 0 ) == dialect.openQuote() && name.charAt( name.length() - 1 ) == dialect.closeQuote() ) ); }
/** * Apply dialect-specific quoting. * <p/> * By default, the incoming value is checked to see if its first character * is the back-tick (`). If so, the dialect specific quoting is applied. * * @param name The value to be quoted. * @return The quoted (or unmodified, if not starting with back-tick) value. * @see #openQuote() * @see #closeQuote() */ public final String quote(String name) { if ( name == null ) { return null; } if ( name.charAt( 0 ) == '`' ) { return openQuote() + name.substring( 1, name.length() - 1 ) + closeQuote(); } else { return name; } }
public String getQuotedName(Dialect d) { return safeInterning( quoted ? d.openQuote() + name + d.closeQuote() : name ); }
/** * If this is a quoted identifier, then return the identifier name * enclosed in dialect-specific open- and end-quotes; otherwise, * simply return the unquoted identifier. * * @param dialect The dialect whose dialect-specific quoting should be used. * * @return if quoted, identifier name enclosed in dialect-specific open- and * end-quotes; otherwise, the unquoted identifier. */ public String render(Dialect dialect) { return isQuoted ? String.valueOf( dialect.openQuote() ) + getText() + dialect.closeQuote() : getText(); }
@Override public boolean isMatch(Dialect dialect) { return '"' == dialect.openQuote() && '"' == dialect.closeQuote(); } }
@Override public void execute(Connection connection) throws SQLException { final String sql = "update " + getDialect().openQuote() + "foos" + getDialect().closeQuote() + " set long_ = -3"; Statement st = connection.createStatement(); st.executeUpdate( sql ); } }
@Override public Integer execute(Connection connection) throws SQLException { final String sql = "update " + getDialect().openQuote() + "glarchez" + getDialect().closeQuote() + " set baz_map_id=null where baz_map_index='a'"; Statement st = connection.createStatement(); return st.executeUpdate( sql ); } }
.append( "=><!+-*/()',|&`" ) .append( StringHelper.WHITESPACE ) .append( dialect.openQuote() ) .append( dialect.closeQuote() ) .toString(); isOpenQuote = !quotedIdentifier; token = lcToken = isOpenQuote ? Character.toString( dialect.openQuote() ) : Character.toString( dialect.closeQuote() ); quotedIdentifier = isOpenQuote; isQuoteCharacter = true; else if ( !quotedIdentifier && ( dialect.openQuote()==token.charAt(0) ) ) { isOpenQuote = true; quotedIdentifier = true;
private boolean isQuoted(String sqlType, StandardServiceRegistry ssr) { final Dialect dialect = ssr.getService( JdbcEnvironment.class ).getDialect(); return sqlType.charAt( 0 ) == dialect.openQuote() && sqlType.charAt( sqlType.length()-1 ) == dialect.closeQuote(); }
String symbols = ParserHelper.HQL_SEPARATORS + dialect.openQuote() + dialect.closeQuote(); StringTokenizer tokens = new StringTokenizer( sqlFragment, symbols, true ); StringBuilder result = new StringBuilder();
"from CompositeIdId " + "where %1$s=? and id=?", getDialect().openQuote() + "user" + getDialect().closeQuote() );
protected String unquotedIdentifier(String identifier) { //This is a hack. if(identifier.startsWith(dialect.openQuote() + "")) { return identifier.substring(1, identifier.length() - 1); } else { return identifier; } } }
public String getQuotedName(Dialect dialect) { return quoted ? dialect.openQuote() + name + dialect.closeQuote() : name; }
public String getQuotedName(Dialect d) { return quoted ? d.openQuote() + name + d.closeQuote() : name; }
public String getQuotedName(Dialect d) { return quoted ? d.openQuote() + name + d.closeQuote() : name; }
public String getQuotedName(Dialect d) { return quoted ? d.openQuote() + name + d.closeQuote() : name; }
public String getQuotedSchema(Dialect dialect) { return schemaQuoted ? dialect.openQuote() + schema + dialect.closeQuote() : schema; }
public String getQuotedName(Dialect dialect) { return quoted ? dialect.openQuote() + name + dialect.closeQuote() : name; }
public String getQuotedName(Dialect d) { return quoted ? d.openQuote() + name + d.closeQuote() : name; }