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

x33g5p2x  于2022-01-29 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(103)

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

Table.equals介绍

暂无

代码示例

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

@Override
public boolean equals(Object object) {
  return object instanceof Table && equals((Table) object);
}

代码示例来源: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

public void addProperty(Property prop, Ejb3Column[] columns, XClass declaringClass) {
  //Ejb3Column.checkPropertyConsistency( ); //already called earlier
  /*
   * Check table matches between the component and the columns
   * if not, change the component table if no properties are set
   * if a property is set already the core cannot support that
   */
  if (columns != null) {
    Table table = columns[0].getTable();
    if ( !table.equals( component.getTable() ) ) {
      if ( component.getPropertySpan() == 0 ) {
        component.setTable( table );
      }
      else {
        throw new AnnotationException(
            "A component cannot hold properties split into 2 different tables: "
                + this.getPath()
        );
      }
    }
  }
  addProperty( prop, declaringClass );
}

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

public static void checkPropertyConsistency(Ejb3Column[] columns, String propertyName) {
  int nbrOfColumns = columns.length;
  if ( nbrOfColumns > 1 ) {
    for (int currentIndex = 1; currentIndex < nbrOfColumns; currentIndex++) {
      if (columns[currentIndex].isFormula() || columns[currentIndex - 1].isFormula()) {
        continue;
      }
      if ( columns[currentIndex].isInsertable() != columns[currentIndex - 1].isInsertable() ) {
        throw new AnnotationException(
            "Mixing insertable and non insertable columns in a property is not allowed: " + propertyName
        );
      }
      if ( columns[currentIndex].isNullable() != columns[currentIndex - 1].isNullable() ) {
        throw new AnnotationException(
            "Mixing nullable and non nullable columns in a property is not allowed: " + propertyName
        );
      }
      if ( columns[currentIndex].isUpdatable() != columns[currentIndex - 1].isUpdatable() ) {
        throw new AnnotationException(
            "Mixing updatable and non updatable columns in a property is not allowed: " + propertyName
        );
      }
      if ( !columns[currentIndex].getTable().equals( columns[currentIndex - 1].getTable() ) ) {
        throw new AnnotationException(
            "Mixing different tables in a property is not allowed: " + propertyName
        );
      }
    }
  }
}

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

@Override
public boolean equals(Object object) {
  return object instanceof Table && equals( (Table) object );
}

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

/** return true if this foreignkey is the only reference from this table to the same foreign table */
private boolean isUniqueReference(ForeignKey foreignKey) {
  Iterator<?> foreignKeyIterator = foreignKey.getTable().getForeignKeyIterator();
  while ( foreignKeyIterator.hasNext() ) {
    ForeignKey element = (ForeignKey) foreignKeyIterator.next();
    if(element!=foreignKey && element.getReferencedTable().equals(foreignKey.getReferencedTable())) {
      return false;
    }
  }
  return true;
}

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

/** return true if this foreignkey is the only reference from this table to the same foreign table */
private boolean isUniqueReference(ForeignKey foreignKey) {
  Iterator<?> foreignKeyIterator = foreignKey.getTable().getForeignKeyIterator();
  while ( foreignKeyIterator.hasNext() ) {
    ForeignKey element = (ForeignKey) foreignKeyIterator.next();
    if(element!=foreignKey && element.getReferencedTable().equals(foreignKey.getReferencedTable())) {
      return false;
    }
  }
  return true;
}

相关文章

微信公众号

最新文章

更多