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

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

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

Column.getValue介绍

暂无

代码示例

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

private boolean propertyIteratorContainsColumn(Iterator propertyIterator, Column column) {
  for ( Iterator it = propertyIterator; it.hasNext(); ) {
    final Property property = (Property) it.next();
    for ( Iterator<Selectable> selectableIterator = property.getColumnIterator(); selectableIterator.hasNext(); ) {
      final Selectable selectable = selectableIterator.next();
      if ( column.equals( selectable ) ) {
        final Column iteratedColumn = (Column) selectable;
        if ( column.getValue().getTable().equals( iteratedColumn.getValue().getTable() ) ) {
          return true;
        }
      }
    }
  }
  return false;
}

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

protected String getTableNameForLogging(Column column) {
  if ( getTable() != null ) {
    if ( getTable().getNameIdentifier() != null ) {
      return getTable().getNameIdentifier().getCanonicalName();
    }
    else {
      return "<unknown>";
    }
  }
  else if ( column.getValue() != null && column.getValue().getTable() != null ) {
    return column.getValue().getTable().getNameIdentifier().getCanonicalName();
  }
  return "<unknown>";
}

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

public int getSqlTypeCode(Mapping mapping) throws MappingException {
  org.hibernate.type.Type type = getValue().getType();
  try {
    int sqlTypeCode = type.sqlTypes( mapping )[getTypeIndex()];
    if ( getSqlTypeCode() != null && getSqlTypeCode() != sqlTypeCode ) {
      throw new MappingException( "SQLType code's does not match. mapped as " + sqlTypeCode + " but is " + getSqlTypeCode() );
    }
    return sqlTypeCode;
  }
  catch (Exception e) {
    throw new MappingException(
        "Could not determine type for column " +
            name +
            " of type " +
            type.getClass().getName() +
            ": " +
            e.getClass().getName(),
        e
    );
  }
}

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

@Test
  @TestForIssue(jiraKey = "HHH-5848")
  public void testDatabaseTableNames() {
    PersistentClass classMapping = metadata().getEntityBinding( Item.class.getName() );
    Column secTabColumn = (Column) classMapping.getProperty( "specialPrice" ).getColumnIterator().next();
    assertEquals( "TAB_ITEMS_SEC", secTabColumn.getValue().getTable().getName() );
    Column tabColumn = (Column) classMapping.getProperty( "price" ).getColumnIterator().next();
    assertEquals( "TAB_ITEMS", tabColumn.getValue().getTable().getName() );
  }
}

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

private void checkColumn(Column column) {
  if(column.getValue()!=null) {
    //throw new JDBCBinderException("Binding column twice should not happen. " + column);
  }
}

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

private void checkColumn(Column column) {
  if(column.getValue()!=null) {
    //throw new JDBCBinderException("Binding column twice should not happen. " + column);
  }
}

代码示例来源:origin: appfuse/appfuse

/**
 * Method to generate a random value for use in setting WebTest parameters
 * @param column the type of object (i.e. "java.util.Date")
 * @return The string-ified version of the date
 */
public String getValueForWebTest(Column column) {
  String type = column.getValue().getType().getReturnedClass().getName();
  String value = getTestValueForDbUnit(column);
  if (type.equalsIgnoreCase(Date.class.getName())) {
    value = getDate(new Date(), uiDatePattern);
  } else if ("boolean".equals(type) || "java.lang.Boolean".equals(type)) {
    value = "true";
  }
  return value;
}

代码示例来源:origin: appfuse/appfuse

String type = column.getValue().getType().getReturnedClass().getName();

代码示例来源:origin: appfuse/appfuse

String type = column.getValue().getType().getReturnedClass().getName();

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

public int getSqlTypeCode(Mapping mapping) throws MappingException {
  org.hibernate.type.Type type = getValue().getType();
  try {
    int sqlTypeCode = type.sqlTypes(mapping)[ getTypeIndex() ];
    if(getSqlTypeCode()!=null && getSqlTypeCode().intValue()!=sqlTypeCode) {
      throw new MappingException("SQLType code's does not match. mapped as " + sqlTypeCode + " but is " + getSqlTypeCode() );
    }
    return sqlTypeCode;
  }
  catch (Exception e) {
    throw new MappingException(
      "Could not determine type for column " +
      name +
      " of type " +
      type.getClass().getName() +
      ": " +
      e.getClass().getName(),
      e
    );
  }
}

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

private String fieldType(Column currentColumn) {
  TypeTranslator translator = serviceRegistry.getService( TypeTranslator.class );
  Type valueType = currentColumn.getValue().getType();
  GridType gridType = translator.getType( valueType );
  if ( gridType instanceof EnumType ) {
    return enumFieldType( (EnumType) gridType );
  }
  if ( gridType instanceof YesNoType ) {
    return STRING_CLASS_NAME;
  }
  if ( gridType instanceof NumericBooleanType ) {
    return INTEGER_CLASS_NAME;
  }
  Class<?> returnedClass = valueType.getReturnedClass();
  if ( Character.class.equals( returnedClass ) ) {
    return STRING_CLASS_NAME;
  }
  return returnedClass.getName();
}

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

public int getSqlTypeCode(Mapping mapping) throws MappingException {
  org.hibernate.type.Type type = getValue().getType();
  try {
    int sqlTypeCode = type.sqlTypes(mapping)[ getTypeIndex() ];
    if(getSqlTypeCode()!=null && getSqlTypeCode().intValue()!=sqlTypeCode) {
      throw new MappingException("SQLType code's does not match. mapped as " + sqlTypeCode + " but is " + getSqlTypeCode() );
    }
    return sqlTypeCode;
  }
  catch (Exception e) {
    throw new MappingException(
        "Could not determine type for column " +
        name +
        " of type " +
        type.getClass().getName() +
        ": " +
        e.getClass().getName(),
        e
      );
  }
}

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

public int getSqlTypeCode(Mapping mapping) throws MappingException {
  org.hibernate.type.Type type = getValue().getType();
  try {
    int sqlTypeCode = type.sqlTypes( mapping )[getTypeIndex()];
    if ( getSqlTypeCode() != null && getSqlTypeCode() != sqlTypeCode ) {
      throw new MappingException( "SQLType code's does not match. mapped as " + sqlTypeCode + " but is " + getSqlTypeCode() );
    }
    return sqlTypeCode;
  }
  catch ( Exception e ) {
    throw new MappingException(
        "Could not determine type for column " +
            name +
            " of type " +
            type.getClass().getName() +
            ": " +
            e.getClass().getName(),
        e
    );
  }
}

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

public int getSqlTypeCode(Mapping mapping) throws MappingException {
  org.hibernate.type.Type type = getValue().getType();
  try {
    int sqlTypeCode = type.sqlTypes( mapping )[getTypeIndex()];
    if ( getSqlTypeCode() != null && getSqlTypeCode() != sqlTypeCode ) {
      throw new MappingException( "SQLType code's does not match. mapped as " + sqlTypeCode + " but is " + getSqlTypeCode() );
    }
    return sqlTypeCode;
  }
  catch ( Exception e ) {
    throw new MappingException(
        "Could not determine type for column " +
            name +
            " of type " +
            type.getClass().getName() +
            ": " +
            e.getClass().getName(),
        e
    );
  }
}

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

Column column = columnIterator.next();
columnNames.add( column.getName() );
Value value = column.getValue();
Type type = value.getType();
  type = ( (org.hibernate.type.ComponentType) column.getValue().getType() ).getSubtypes()[index];

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

@Override
  public ParameterMetadata buildParameterMetadata(String nativeQuery) {
    PreparedStatement preparedStatement = session.prepare( nativeQuery );
    ColumnDefinitions columnDefinitions = preparedStatement.getVariables();
    OrdinalParameterDescriptor[] ordinalDescriptors = new OrdinalParameterDescriptor[columnDefinitions.size()];

    if ( columnDefinitions.size() > 0 ) {

      // the cassandra metadata will give us the CQL type, but the type conversion system only goes
      // in hibernate->cassandra direction, so we can't turn it back into the required hibernate type.
      // instead we rely on the cached hibernate metadata from schema creation time

      String tableName = columnDefinitions.getTable( 0 );
      Table table = metaDataCache.get( tableName );

      for ( ColumnDefinitions.Definition definition : columnDefinitions ) {
        String name = definition.getName();
        Column column = table.getColumn( Identifier.toIdentifier( name ) );
        Type hibernateType = column.getValue().getType();
        // cassandra side index is 0-based, hibernate side index is 1-based
        int index = columnDefinitions.getIndexOf( name );
        ordinalDescriptors[index] = new OrdinalParameterDescriptor( index + 1, hibernateType, 0 );
      }
    }

    return new ParameterMetadata( ordinalDescriptors, null );
  }
}

代码示例来源:origin: com.vecna/dbDiff-hibernate

column.setColumnSize(mappedColumn.getPrecision());
} else if ("character".equals(mappedColumn.getValue().getType().getName())) {
 column.setColumnSize(1);
} else if (!"binary".equals(mappedColumn.getValue().getType().getName())
  && mappedColumn.getLength() != org.hibernate.mapping.Column.DEFAULT_LENGTH) {
 column.setColumnSize(mappedColumn.getLength());

代码示例来源:origin: org.hibernate.ogm/hibernate-ogm-infinispan-remote

Value value = column.getValue();
Type type = value.getType();
if ( type.isAssociationType() ) {
  type = ( (org.hibernate.type.ComponentType) column.getValue().getType() ).getSubtypes()[index];

代码示例来源:origin: com.manydesigns/portofino-database

SimpleValue id = (SimpleValue) col.getValue();

代码示例来源:origin: ManyDesigns/Portofino

SimpleValue id = (SimpleValue) col.getValue();

相关文章