本文整理了Java中org.hibernate.mapping.Column.setPrecision()
方法的一些代码示例,展示了Column.setPrecision()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Column.setPrecision()
方法的具体详情如下:
包路径:org.hibernate.mapping.Column
类名称:Column
方法名:setPrecision
暂无
代码示例来源:origin: hibernate/hibernate-orm
private static void applyDigits(Property property, ConstraintDescriptor> descriptor) {
if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) {
@SuppressWarnings("unchecked")
ConstraintDescriptor
int integerDigits = digitsConstraint.getAnnotation().integer();
int fractiOnalDigits= digitsConstraint.getAnnotation().fraction();
@SuppressWarnings("unchecked")
final Iterator
if ( itor.hasNext() ) {
final Selectable selectable = itor.next();
if ( Column.class.isInstance( selectable ) ) {
Column col = (Column) selectable;
col.setPrecision( integerDigits + fractionalDigits );
col.setScale( fractionalDigits );
}
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
private void applyComponentColumnSizeValueToJoinColumn(Column column, Ejb3JoinColumn joinColumn) {
Column mappingColumn = joinColumn.getMappingColumn();
mappingColumn.setLength( column.getLength() );
mappingColumn.setPrecision( column.getPrecision() );
mappingColumn.setScale( column.getScale() );
}
代码示例来源:origin: hibernate/hibernate-orm
this.mappingColumn.setLength( length );
if ( precision > 0 ) { //revelent precision
this.mappingColumn.setPrecision( precision );
this.mappingColumn.setScale( scale );
代码示例来源:origin: hibernate/hibernate-orm
/**
* Called to apply column definitions from the referenced FK column to this column.
*
* @param column the referenced column.
*/
public void overrideFromReferencedColumnIfNecessary(org.hibernate.mapping.Column column) {
if (getMappingColumn() != null) {
// columnDefinition can also be specified using @JoinColumn, hence we have to check
// whether it is set or not
if ( StringHelper.isEmpty( sqlType ) ) {
sqlType = column.getSqlType();
getMappingColumn().setSqlType( sqlType );
}
// these properties can only be applied on the referenced column - we can just take them over
getMappingColumn().setLength(column.getLength());
getMappingColumn().setPrecision(column.getPrecision());
getMappingColumn().setScale(column.getScale());
}
}
代码示例来源:origin: hibernate/hibernate-orm
/**
* Shallow copy, the value is not copied
*/
@Override
public Column clone() {
Column copy = new Column();
copy.setLength( length );
copy.setScale( scale );
copy.setValue( value );
copy.setTypeIndex( typeIndex );
copy.setName( getQuotedName() );
copy.setNullable( nullable );
copy.setPrecision( precision );
copy.setUnique( unique );
copy.setSqlType( sqlType );
copy.setSqlTypeCode( sqlTypeCode );
copy.uniqueInteger = uniqueInteger; //usually useless
copy.setCheckConstraint( checkConstraint );
copy.setComment( comment );
copy.setDefaultValue( defaultValue );
copy.setCustomRead( customRead );
copy.setCustomWrite( customWrite );
return copy;
}
代码示例来源:origin: hibernate/hibernate-orm
copy.setName( column.getQuotedName() );
copy.setNullable( column.isNullable() );
copy.setPrecision( column.getPrecision() );
copy.setUnique( column.isUnique() );
copy.setSqlType( column.getSqlType() );
代码示例来源:origin: org.hibernate/hibernate-annotations
private static void applyDigits(Property property, ConstraintDescriptor> descriptor) {
if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) {
@SuppressWarnings( "unchecked" )
ConstraintDescriptor
int integerDigits = digitsConstraint.getAnnotation().integer();
int fractiOnalDigits= digitsConstraint.getAnnotation().fraction();
Column col = (Column) property.getColumnIterator().next();
col.setPrecision( integerDigits + fractionalDigits );
col.setScale( fractionalDigits );
}
}
代码示例来源:origin: hibernate/hibernate-orm
column.setPrecision( columnSource.getSizeSource().getPrecision() );
column.setPrecision( Column.DEFAULT_PRECISION );
代码示例来源:origin: hibernate/hibernate-orm
copy.setName( column.getQuotedName() );
copy.setNullable( column.isNullable() );
copy.setPrecision( column.getPrecision() );
copy.setUnique( column.isUnique() );
copy.setSqlType( column.getSqlType() );
代码示例来源:origin: org.hibernate/hibernate-annotations
protected void initMappingColumn(
String columnName,
String propertyName,
int length,
int precision,
int scale,
boolean nullable,
String sqlType,
boolean unique,
boolean applyNamingStrategy) {
if ( StringHelper.isNotEmpty( formulaString ) ) {
this.formula = new Formula();
this.formula.setFormula( formulaString );
}
else {
this.mappingColumn = new Column();
redefineColumnName( columnName, propertyName, applyNamingStrategy );
this.mappingColumn.setLength( length );
if ( precision > 0 ) { //revelent precision
this.mappingColumn.setPrecision( precision );
this.mappingColumn.setScale( scale );
}
this.mappingColumn.setNullable( nullable );
this.mappingColumn.setSqlType( sqlType );
this.mappingColumn.setUnique( unique );
}
}
代码示例来源:origin: org.hibernate/hibernate-annotations
/**
* Called to apply column definitions from the referenced FK column to this column.
*
* @param column the referenced column.
*/
public void overrideFromReferencedColumnIfNecessary(org.hibernate.mapping.Column column) {
if (getMappingColumn() != null) {
// columnDefinition can also be specified using @JoinColumn, hence we have to check
// whether it is set or not
if ( StringHelper.isEmpty( sqlType ) ) {
sqlType = column.getSqlType();
getMappingColumn().setSqlType( sqlType );
}
// these properties can only be applied on the referenced column - we can just take them over
getMappingColumn().setLength(column.getLength());
getMappingColumn().setPrecision(column.getPrecision());
getMappingColumn().setScale(column.getScale());
}
}
代码示例来源:origin: org.hibernate/hibernate-validator-legacy
public void apply(Property property) {
Column col = (Column) property.getColumnIterator().next();
col.setPrecision( integerDigits + fractionalDigits );
col.setScale( fractionalDigits );
}
}
代码示例来源:origin: org.hibernate/hibernate-annotations
copy.setName( column.getQuotedName() );
copy.setNullable( column.isNullable() );
copy.setPrecision( column.getPrecision() );
copy.setUnique( column.isUnique() );
copy.setSqlType( column.getSqlType() );
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
private static void applyDigits(Property property, ConstraintDescriptor> descriptor) {
if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) {
@SuppressWarnings("unchecked")
ConstraintDescriptor
int integerDigits = digitsConstraint.getAnnotation().integer();
int fractiOnalDigits= digitsConstraint.getAnnotation().fraction();
Column col = (Column) property.getColumnIterator().next();
col.setPrecision( integerDigits + fractionalDigits );
col.setScale( fractionalDigits );
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
private static void applyDigits(Property property, ConstraintDescriptor> descriptor) {
if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) {
@SuppressWarnings("unchecked")
ConstraintDescriptor
int integerDigits = digitsConstraint.getAnnotation().integer();
int fractiOnalDigits= digitsConstraint.getAnnotation().fraction();
Column col = (Column) property.getColumnIterator().next();
col.setPrecision( integerDigits + fractionalDigits );
col.setScale( fractionalDigits );
}
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
private static void applyDigits(PersistentAttributeMapping property, ConstraintDescriptor> descriptor) {
if ( Digits.class.equals( descriptor.getAnnotation().annotationType() ) ) {
@SuppressWarnings("unchecked")
final ConstraintDescriptor
final int integerDigits = digitsConstraint.getAnnotation().integer();
final int fractiOnalDigits= digitsConstraint.getAnnotation().fraction();
final Column col = getColumn( property );
col.setPrecision( integerDigits + fractionalDigits );
col.setScale( fractionalDigits );
}
}
代码示例来源:origin: org.hibernate/hibernate-annotations
copy.setName( column.getQuotedName() );
copy.setNullable( column.isNullable() );
copy.setPrecision( column.getPrecision() );
copy.setUnique( column.isUnique() );
copy.setSqlType( column.getSqlType() );
代码示例来源:origin: org.hibernate.orm/hibernate-core
private void applyComponentColumnValuesToJoinColumn(Column column, Ejb3JoinColumn joinColumn) {
Column mappingColumn = joinColumn.getMappingColumn();
mappingColumn.setLength( column.getLength() );
mappingColumn.setPrecision( column.getPrecision() );
mappingColumn.setScale( column.getScale() );
mappingColumn.setNullable( column.isNullable() );
}
代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all
protected void initMappingColumn(
String columnName, String propertyName, int length, int precision, int scale, boolean nullable,
String sqlType, boolean unique, boolean applyNamingStrategy
) {
this.mappingColumn = new Column();
redefineColumnName( columnName, propertyName, applyNamingStrategy );
this.mappingColumn.setLength( length );
if ( precision > 0 ) { //revelent precision
this.mappingColumn.setPrecision( precision );
this.mappingColumn.setScale( scale );
}
this.mappingColumn.setNullable( nullable );
this.mappingColumn.setSqlType( sqlType );
this.mappingColumn.setUnique( unique );
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
/**
* Called to apply column definitions from the referenced FK column to this column.
*
* @param column the referenced column.
*/
public void overrideFromReferencedColumnIfNecessary(org.hibernate.mapping.Column column) {
if (getMappingColumn() != null) {
// columnDefinition can also be specified using @JoinColumn, hence we have to check
// whether it is set or not
if ( StringHelper.isEmpty( sqlType ) ) {
sqlType = column.getSqlType();
getMappingColumn().setSqlType( sqlType );
}
// these properties can only be applied on the referenced column - we can just take them over
getMappingColumn().setLength(column.getLength());
getMappingColumn().setPrecision(column.getPrecision());
getMappingColumn().setScale(column.getScale());
}
}