org.hibernate.mapping.Column.setDefaultValue()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中org.hibernate.mapping.Column.setDefaultValue()方法的一些代码示例,展示了Column.setDefaultValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Column.setDefaultValue()方法的具体详情如下:
包路径:org.hibernate.mapping.Column
类名称:Column
方法名:setDefaultValue

Column.setDefaultValue介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

public void bind() {
  if ( StringHelper.isNotEmpty( formulaString ) ) {
    LOG.debugf( "Binding formula %s", formulaString );
    formula = new Formula();
    formula.setFormula( formulaString );
  }
  else {
    initMappingColumn(
        logicalColumnName, propertyName, length, precision, scale, nullable, sqlType, unique, true
    );
    if ( defaultValue != null ) {
      mappingColumn.setDefaultValue( defaultValue );
    }
    if ( LOG.isDebugEnabled() ) {
      LOG.debugf( "Binding column: %s", toString() );
    }
  }
}

代码示例来源: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.setCheckConstraint( column.getCheckConstraint() );
copy.setComment( column.getComment() );
copy.setDefaultValue( column.getDefaultValue() );
key.addColumn( copy );

代码示例来源:origin: hibernate/hibernate-orm

copy.setCheckConstraint( column.getCheckConstraint() );
copy.setComment( column.getComment() );
copy.setDefaultValue( column.getDefaultValue() );
manyToOne.addColumn( copy );

代码示例来源:origin: hibernate/hibernate-orm

column.setDefaultValue( columnSource.getDefaultValue() );
column.setSqlType( columnSource.getSqlType() );

代码示例来源:origin: org.hibernate/hibernate-annotations

copy.setCheckConstraint( column.getCheckConstraint() );
copy.setComment( column.getComment() );
copy.setDefaultValue( column.getDefaultValue() );
key.addColumn( copy );

代码示例来源:origin: org.hibernate/hibernate-annotations

copy.setCheckConstraint( column.getCheckConstraint() );
copy.setComment( column.getComment() );
copy.setDefaultValue( column.getDefaultValue() );
manyToOne.addColumn( copy );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public static void bindColumn(Element node, Column column, boolean isNullable) throws MappingException {
  Attribute lengthNode = node.attribute( "length" );
  if ( lengthNode != null ) column.setLength( Integer.parseInt( lengthNode.getValue() ) );
  Attribute scalNode = node.attribute( "scale" );
  if ( scalNode != null ) column.setScale( Integer.parseInt( scalNode.getValue() ) );
  Attribute precNode = node.attribute( "precision" );
  if ( precNode != null ) column.setPrecision( Integer.parseInt( precNode.getValue() ) );
  Attribute nullNode = node.attribute( "not-null" );
  column.setNullable( nullNode == null ? isNullable : nullNode.getValue().equals( "false" ) );
  Attribute unqNode = node.attribute( "unique" );
  if ( unqNode != null ) column.setUnique( unqNode.getValue().equals( "true" ) );
  column.setCheckConstraint( node.attributeValue( "check" ) );
  column.setDefaultValue( node.attributeValue( "default" ) );
  Attribute typeNode = node.attribute( "sql-type" );
  if ( typeNode != null ) column.setSqlType( typeNode.getValue() );
  String customWrite = node.attributeValue( "write" );
  if(customWrite != null && !customWrite.matches("[^?]*\\?[^?]*")) {
    throw new MappingException("write expression must contain exactly one value placeholder ('?') character");
  }
  column.setCustomWrite( customWrite );
  column.setCustomRead( node.attributeValue( "read" ) );
  Element comment = node.element("comment");
  if (comment!=null) column.setComment( comment.getTextTrim() );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public static void bindColumn(Element node, Column column, boolean isNullable) throws MappingException {
  Attribute lengthNode = node.attribute( "length" );
  if ( lengthNode != null ) column.setLength( Integer.parseInt( lengthNode.getValue() ) );
  Attribute scalNode = node.attribute( "scale" );
  if ( scalNode != null ) column.setScale( Integer.parseInt( scalNode.getValue() ) );
  Attribute precNode = node.attribute( "precision" );
  if ( precNode != null ) column.setPrecision( Integer.parseInt( precNode.getValue() ) );
  Attribute nullNode = node.attribute( "not-null" );
  column.setNullable( nullNode == null ? isNullable : nullNode.getValue().equals( "false" ) );
  Attribute unqNode = node.attribute( "unique" );
  if ( unqNode != null ) column.setUnique( unqNode.getValue().equals( "true" ) );
  column.setCheckConstraint( node.attributeValue( "check" ) );
  column.setDefaultValue( node.attributeValue( "default" ) );
  Attribute typeNode = node.attribute( "sql-type" );
  if ( typeNode != null ) column.setSqlType( typeNode.getValue() );
  String customWrite = node.attributeValue( "write" );
  if(customWrite != null && !customWrite.matches("[^?]*\\?[^?]*")) {
    throw new MappingException("write expression must contain exactly one value placeholder ('?') character");
  }
  column.setCustomWrite( customWrite );
  column.setCustomRead( node.attributeValue( "read" ) );
  Element comment = node.element("comment");
  if (comment!=null) column.setComment( comment.getTextTrim() );
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

public void bind() {
  if ( !binded ) {
    if ( StringHelper.isNotEmpty( formulaString ) ) {
      LOG.debugf( "Binding formula %s", formulaString );
      formula = new Formula( formulaString );
    }
    else {
      initMappingColumn(
          logicalColumnName, propertyName, length, precision, scale, nullable, sqlType, unique, true
      );
      if ( defaultValue != null ) {
        mappingColumn.setDefaultValue( defaultValue );
      }
      if ( LOG.isDebugEnabled() ) {
        LOG.debugf( "Binding column: %s", toString() );
      }
    }
  }
  binded = true;
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

/**
 * Shallow copy, the value is not copied
 */
protected Object 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 );
  return copy;
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public static void bindColumn(Element node, Column column, boolean isNullable) {
  Attribute lengthNode = node.attribute( "length" );
  if ( lengthNode != null ) column.setLength( Integer.parseInt( lengthNode.getValue() ) );
  Attribute scalNode = node.attribute( "scale" );
  if ( scalNode != null ) column.setScale( Integer.parseInt( scalNode.getValue() ) );
  Attribute precNode = node.attribute( "precision" );
  if ( precNode != null ) column.setPrecision( Integer.parseInt( precNode.getValue() ) );
  Attribute nullNode = node.attribute( "not-null" );
  column.setNullable( nullNode == null ? isNullable : nullNode.getValue().equals( "false" ) );
  Attribute unqNode = node.attribute( "unique" );
  if ( unqNode != null ) column.setUnique( unqNode.getValue().equals( "true" ) );
  column.setCheckConstraint( node.attributeValue( "check" ) );
  column.setDefaultValue( node.attributeValue( "default" ) );
  Attribute typeNode = node.attribute( "sql-type" );
  if ( typeNode != null ) column.setSqlType( typeNode.getValue() );
  Element comment = node.element("comment");
  if (comment!=null) column.setComment( comment.getTextTrim() );
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

/**
 * Shallow copy, the value is not copied
 */
@Override
public Column clone() {
  Column copy = new Column( name, unique );
  copy.setTableName( tableName );
  copy.setLength( length );
  copy.setScale( scale );
  copy.setNullable( nullable );
  copy.setPrecision( precision );
  copy.setSqlType( sqlType );
  copy.setUniqueInteger( uniqueInteger ); //usually useless
  copy.setCheckConstraint( checkConstraint );
  copy.setComment( comment );
  copy.setDefaultValue( defaultValue );
  copy.setCustomRead( customRead );
  copy.setCustomWrite( customWrite );
  copy.setSqlTypeDescriptorAccess( sqlTypeDescriptorAccess );
  copy.setJavaTypeMapping( javaTypeMapping );
  return copy;
}

代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core

column.setDefaultValue(cc.getDefaultValue());
column.setCustomRead(cc.getRead());
column.setCustomWrite(cc.getWrite());

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Shallow copy, the value is not copied
 */
protected Object 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: org.hibernate/com.springsource.org.hibernate

/**
 * Shallow copy, the value is not copied
 */
protected Object 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: jboss.jboss-embeddable-ejb3/hibernate-all

copy.setCheckConstraint( column.getCheckConstraint() );
copy.setComment( column.getComment() );
copy.setDefaultValue( column.getDefaultValue() );
key.addColumn( copy );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

copy.setCheckConstraint( column.getCheckConstraint() );
copy.setComment( column.getComment() );
copy.setDefaultValue( column.getDefaultValue() );
key.addColumn( copy );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

copy.setCheckConstraint( column.getCheckConstraint() );
copy.setComment( column.getComment() );
copy.setDefaultValue( column.getDefaultValue() );
key.addColumn( copy );

代码示例来源:origin: org.hibernate.orm/hibernate-core

column.setDefaultValue( columnSource.getDefaultValue() );
column.setSqlType( columnSource.getSqlType() );

相关文章