Hibernate ORM Dialect - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM Dialect class.

This code example shows how to use the following methods: closeQuote, getDropForeignKeyString, openQuote, quote, supportsIfExistsAfterConstraintName
 
	public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema) {
		return "alter table " +  
			getTable().getQualifiedName(dialect, defaultCatalog, defaultSchema) + 
			dialect.getDropForeignKeyString() + 
			getName();
	} 
 
	public boolean isCascadeDeleteEnabled() { 
		return cascadeDeleteEnabled;
	} 
 
	public void setCascadeDeleteEnabled(boolean cascadeDeleteEnabled) {
		this.cascadeDeleteEnabled = cascadeDeleteEnabled;
	} 
	 
	public boolean isPhysicalConstraint() { 
		return referencedTable.isPhysicalTable() && 
				getTable().isPhysicalTable() && 
				!referencedTable.hasDenormalizedTables();

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: closeQuote, openQuote

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: closeQuote, openQuote
	 * @param dialect 
	 * @return if quoted, identifier name enclosed in dialect-specific 
	 *         open- and end-quotes; otherwise, the identifier name. 
	 */ 
	public String encloseInQuotesIfQuoted(Dialect dialect) {
		return isQuoted ?
				new StringBuilder( name.length() + 2 )
						.append( dialect.openQuote() )
						.append( name )
						.append( dialect.closeQuote() )
						.toString() :
				name;
	} 
 
	@Override 
	public String toString() {
		return isQuoted
				? '`' + getName() + '`' 
				: getName(); 
	} 
Full Snippet Info
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: getCaseInsensitiveLike, getLowercaseFunction, supportsCaseInsensitiveLike
			CriteriaQuery criteriaQuery) throws HibernateException {
		Dialect dialect = criteriaQuery.getFactory().getDialect();
		String[] columns = criteriaQuery.findColumns(propertyName, criteria);
		if ( columns.length != 1 ) {
			throw new HibernateException( "Like may only be used with single-column properties" );
		} 
		String escape = escapeChar == null ? "" : " escape \'" + escapeChar + "\'";
		String column = columns[0];
		if ( ignoreCase ) {
			if ( dialect.supportsCaseInsensitiveLike() ) {
				return column +" " + dialect.getCaseInsensitiveLike() + " ?" + escape;
			} 
			else { 
				return dialect.getLowercaseFunction() + '(' + column + ')' + " like ?" + escape;
			} 
		} 
		else { 
			return column + " like ?" + escape;
		} 
	} 
Full Snippet Info
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: closeQuote, openQuote
	public void addColumns(Iterator extraColumns) {
		while ( extraColumns.hasNext() ) addColumn( (Column) extraColumns.next() );
	} 
 
	/** 
	 * @param column 
	 * @return true if this constraint already contains a column with same name. 
	 */ 
	public boolean containsColumn(Column column) {
		return columns.contains( column );
	} 
 
	public String getName() {
		return name;
	} 
 
	public void setName(String name) {
		this.name = name;
	} 
 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: closeQuote, openQuote
		int tmpHashCode = schema != null ? schema.hashCode() : 0;
		tmpHashCode = 31 * tmpHashCode + ( catalog != null ? catalog.hashCode() : 0 );
		tmpHashCode = 31 * tmpHashCode + name.hashCode();
		this.hashCode = tmpHashCode;
	} 
 
	public Identifier getSchema() { 
		return schema;
	} 
 
	public Identifier getCatalog() { 
		return catalog;
	} 
 
	public Identifier getName() { 
		return name;
	} 
 
	public String toText() {
		return identifier;
Full Snippet Info
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: getCreateTableString, getTableTypeString, getTypeName
This code example shows how to use the following methods: quote
	public String[] sqlDropStrings(Dialect dialect) {
		if ( isCreationVetoed( dialect ) ) {
			return null; 
		} 
		else { 
			return new String[] {
					new StringBuffer()
						.append( "alter table " )
						.append( getTable().getQualifiedName( dialect ) )
						.append( " drop constraint " )
						.append( dialect.quote( getName() ) )
						.toString()
			}; 
		} 
	} 
 
	public String[] sqlCreateStrings(Dialect dialect) {
		if ( isCreationVetoed( dialect ) ) {
			return null; 
		} 
Full Snippet Info
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: getNativeIdentifierGeneratorClass
Session session = mock(Session.class);
        SessionFactoryImplementor sessionFactory = mock(SessionFactoryImplementor.class);
        Dialect dialect = mock(Dialect.class);
        when(session.getSessionFactory()).thenReturn(sessionFactory);
        when(sessionFactory.getDialect()).thenReturn(dialect);
        when(dialect.getNativeIdentifierGeneratorClass()).thenReturn(SequenceGenerator.class);
        SQLQuery sqlQuery = mock(SQLQuery.class);
        when(session.createSQLQuery("create sequence schema.hibernate_sequence")).thenReturn(sqlQuery);
        when(sqlQuery.executeUpdate()).thenReturn(0);
 
        this.store.createHibernateSequenceIfRequired(new String[] {}, "schema", session);
 
        verify(session).createSQLQuery("create sequence schema.hibernate_sequence");
        verify(sqlQuery).executeUpdate();
    } 
 
    /** 
     * We verify that the sequence is not created if it's already in the update script. 
     */ 
Full Snippet Info
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: buildSQLExceptionConversionDelegate
 
    public FixedDatabaseMetadata(Connection connection, Dialect dialect, boolean extras) throws SQLException { 
        super(connection, dialect, extras); 
 
        final StandardSQLExceptionConverter ssec = new StandardSQLExceptionConverter(); 
        ssec.addDelegate(dialect.buildSQLExceptionConversionDelegate()); 
        sqlExceptionConverter = ssec; 
        meta = connection.getMetaData(); 
        this.extras = extras; 
        initSequences(connection, dialect); 
    } 
 
    private static final String[] TYPES = {"TABLE", "VIEW"}; 
 
    public TableMetadata getTableMetadata(String name, String schema, String catalog, boolean isQuoted) throws HibernateException { 
 
        Object identifier = identifier(catalog, schema, name); 
        TableMetadata table = (TableMetadata) tables.get(identifier); 
        if (table!=null) { 
            return table; 
Full Snippet Info
5
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Hibernate ORM Dialect Methods: