当前位置: 首页>>代码示例>>Java>>正文


Java Column.getQuotedName方法代码示例

本文整理汇总了Java中org.hibernate.mapping.Column.getQuotedName方法的典型用法代码示例。如果您正苦于以下问题:Java Column.getQuotedName方法的具体用法?Java Column.getQuotedName怎么用?Java Column.getQuotedName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.mapping.Column的用法示例。


在下文中一共展示了Column.getQuotedName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getModifyColumnSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getModifyColumnSql(Mapping mapping, Column column, boolean changeNotNull, boolean changeType)
{
	String columnName = column.getQuotedName(this);

	String nullStr = "";
	if( changeNotNull )
	{
		nullStr = column.isNullable() ? " NULL" : " NOT NULL";
	}
	String typeStr = "";
	if( changeType )
	{
		typeStr = ' ' + column.getSqlType(this, mapping);
	}

	return "MODIFY (" + columnName + typeStr + nullStr + ")";
}
 
开发者ID:equella,项目名称:Equella,代码行数:19,代码来源:ExtendedOracle10gDialect.java

示例2: getModifyColumnSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getModifyColumnSql(Mapping mapping, Column column, boolean changeNotNull, boolean changeType)
{
	StringBuilder sbuf = new StringBuilder();
	String columnName = column.getQuotedName(this);

	if( changeNotNull )
	{
		sbuf.append("ALTER COLUMN ");
		sbuf.append(columnName).append(' ');
		sbuf.append(column.isNullable() ? "DROP" : "SET");
		sbuf.append(" NOT NULL");
	}
	if( changeType )
	{
		if( changeNotNull )
		{
			sbuf.append(", ");
		}
		sbuf.append("ALTER COLUMN ");
		sbuf.append(columnName).append(" TYPE ").append(column.getSqlType(this, mapping));
	}
	return sbuf.toString();
}
 
开发者ID:equella,项目名称:Equella,代码行数:25,代码来源:ExtendedPostgresDialect.java

示例3: bindLogicalToPhysical

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
private void bindLogicalToPhysical(String logicalName, Column physicalColumn) throws DuplicateMappingException {
	final String logicalKey = logicalName.toLowerCase();
	final String physicalName = physicalColumn.getQuotedName();
	final String existingPhysicalName = ( String ) logicalToPhysical.put( logicalKey, physicalName );
	if ( existingPhysicalName != null ) {
		boolean areSamePhysicalColumn = physicalColumn.isQuoted()
				? existingPhysicalName.equals( physicalName )
				: existingPhysicalName.equalsIgnoreCase( physicalName );
		if ( ! areSamePhysicalColumn ) {
			throw new DuplicateMappingException(
					" Table [" + tableName + "] contains logical column name [" + logicalName
							+ "] referenced by multiple physical column names: [" + existingPhysicalName
							+ "], [" + physicalName + "]",
					"column-binding",
					tableName + "." + logicalName
			);
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:20,代码来源:Configuration.java

示例4: getModifyColumnSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getModifyColumnSql(Mapping mapping, Column column, boolean changeNotNull, boolean changeType)
{
	String columnName = column.getQuotedName(this);
	String nullStr = column.isNullable() ? " NULL" : " NOT NULL";
	String typeStr = ' ' + column.getSqlType(this, mapping);
	return "ALTER COLUMN " + columnName + typeStr + nullStr;
}
 
开发者ID:equella,项目名称:Equella,代码行数:9,代码来源:SQLServerDialect.java

示例5: getAddNotNullSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getAddNotNullSql(Mapping mapping, Column column)
{
	String columnName = column.getQuotedName(this);

	String typeStr = ' ' + column.getSqlType(this, mapping);
	return "ALTER COLUMN " + columnName + typeStr + " NOT NULL";
}
 
开发者ID:equella,项目名称:Equella,代码行数:9,代码来源:SQLServerDialect.java

示例6: getDropColumnSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getDropColumnSql(String table, Column column)
{
	String dropSQL = dropConstraintsSQL.replaceAll("\\$table", Matcher.quoteReplacement(table));
	dropSQL = dropSQL.replaceAll("\\$column", Matcher.quoteReplacement(column.getName()));
	return dropSQL + "\nalter table " + table + " drop column " + column.getQuotedName(this);
}
 
开发者ID:equella,项目名称:Equella,代码行数:8,代码来源:SQLServerDialect.java

示例7: bindPhysicalToLogical

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
private void bindPhysicalToLogical(String logicalName, Column physicalColumn) throws DuplicateMappingException {
	final String physicalName = physicalColumn.getQuotedName();
	final String existingLogicalName = ( String ) physicalToLogical.put( physicalName, logicalName );
	if ( existingLogicalName != null && ! existingLogicalName.equals( logicalName ) ) {
		throw new DuplicateMappingException(
				" Table [" + tableName + "] contains physical column name [" + physicalName
						+ "] represented by different logical column names: [" + existingLogicalName
						+ "], [" + logicalName + "]",
				"column-binding",
				tableName + "." + physicalName
		);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:Configuration.java

示例8: applyMin

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
private static void applyMin(Property property, ConstraintDescriptor<?> descriptor, Dialect dialect) {
	if ( Min.class.equals( descriptor.getAnnotation().annotationType() ) ) {
		@SuppressWarnings("unchecked")
		ConstraintDescriptor<Min> minConstraint = (ConstraintDescriptor<Min>) descriptor;
		long min = minConstraint.getAnnotation().value();

		Column col = (Column) property.getColumnIterator().next();
		String checkConstraint = col.getQuotedName(dialect) + ">=" + min;
		applySQLCheck( col, checkConstraint );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:TypeSafeActivator.java

示例9: applyMax

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
private static void applyMax(Property property, ConstraintDescriptor<?> descriptor, Dialect dialect) {
	if ( Max.class.equals( descriptor.getAnnotation().annotationType() ) ) {
		@SuppressWarnings("unchecked")
		ConstraintDescriptor<Max> maxConstraint = (ConstraintDescriptor<Max>) descriptor;
		long max = maxConstraint.getAnnotation().value();
		Column col = (Column) property.getColumnIterator().next();
		String checkConstraint = col.getQuotedName(dialect) + "<=" + max;
		applySQLCheck( col, checkConstraint );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:TypeSafeActivator.java

示例10: addColumnBinding

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
public void addColumnBinding(String logicalName, Column finalColumn, Table table) {
	ColumnNames binding = (ColumnNames) columnNameBindingPerTable.get(table);
	if (binding == null) {
		binding = new ColumnNames();
		columnNameBindingPerTable.put(table, binding);
	}
	String oldFinalName = (String) binding.logicalToPhysical.put(
			logicalName.toLowerCase(),
			finalColumn.getQuotedName()
	);
	if ( oldFinalName != null &&
			! ( finalColumn.isQuoted() ?
					oldFinalName.equals( finalColumn.getQuotedName() ) :
					oldFinalName.equalsIgnoreCase( finalColumn.getQuotedName() ) ) ) {
		//TODO possibly relax that
		throw new MappingException("Same logical column name referenced by different physical ones: "
				+ table.getName() + "." + logicalName + " => '" + oldFinalName + "' and '" + finalColumn.getQuotedName() + "'" );
	}
	String oldLogicalName = (String) binding.physicalToLogical.put(
			finalColumn.getQuotedName(),
			logicalName
	);
	if ( oldLogicalName != null && ! oldLogicalName.equals( logicalName ) ) {
		//TODO possibly relax that
		throw new MappingException("Same physical column represented by different logical column names: "
				+ table.getName() + "." + finalColumn.getQuotedName() + " => '" + oldLogicalName + "' and '" + logicalName + "'");
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:29,代码来源:Mappings.java

示例11: getAddNotNullSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getAddNotNullSql(Mapping mapping, Column column)
{
	String columnName = column.getQuotedName(this);
	return "MODIFY (" + columnName + " NOT NULL)";
}
 
开发者ID:equella,项目名称:Equella,代码行数:7,代码来源:ExtendedOracle10gDialect.java

示例12: getRenameColumnSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getRenameColumnSql(String table, Column column, String name)
{
	String columnName = column.getQuotedName(this);
	return "ALTER TABLE " + table + " RENAME COLUMN " + columnName + " TO " + name;
}
 
开发者ID:equella,项目名称:Equella,代码行数:7,代码来源:ExtendedOracle10gDialect.java

示例13: getDropColumnSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getDropColumnSql(String table, Column column)
{
	return "ALTER TABLE " + table + " DROP COLUMN " + column.getQuotedName(this) + " CASCADE CONSTRAINTS";
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:ExtendedOracle10gDialect.java

示例14: getAddNotNullSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getAddNotNullSql(Mapping mapping, Column column)
{
	String columnName = column.getQuotedName(this);
	return "ALTER COLUMN " + columnName + " SET NOT NULL";
}
 
开发者ID:equella,项目名称:Equella,代码行数:7,代码来源:ExtendedPostgresDialect.java

示例15: getDropColumnSql

import org.hibernate.mapping.Column; //导入方法依赖的package包/类
@Override
public String getDropColumnSql(String table, Column column)
{
	return "alter table " + table + " drop column " + column.getQuotedName(this);
}
 
开发者ID:equella,项目名称:Equella,代码行数:6,代码来源:ExtendedPostgresDialect.java


注:本文中的org.hibernate.mapping.Column.getQuotedName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。