HHH-5947: 'Fix' that at least improves the error message

This commit is contained in:
Manuel Bernhardt 2011-02-22 17:52:45 +01:00 committed by Emmanuel Bernard
parent 928354827a
commit 9d697660f6
2 changed files with 3 additions and 3 deletions

View File

@ -1550,7 +1550,7 @@ public class Configuration implements Serializable {
sb.append( columnName ).append( ", " );
}
sb.setLength( sb.length() - 2 );
sb.append( ") on table " ).append( table.getName() ).append( ": " );
sb.append( ") on table " ).append( table.getName() ).append( ": database column " );
for ( Column column : unbound ) {
sb.append( column.getName() ).append( ", " );
}
@ -1558,7 +1558,7 @@ public class Configuration implements Serializable {
sb.append( column.getName() ).append( ", " );
}
sb.setLength( sb.length() - 2 );
sb.append( " not found" );
sb.append( " not found. Make sure that you use the correct column name which depends on the naming strategy in use (it may not be the same as the property name in the entity, especially for relational types)" );
throw new AnnotationException( sb.toString() );
}
}

View File

@ -9,7 +9,7 @@ import javax.persistence.UniqueConstraint;
* @author Manuel Bernhardt <bernhardt.manuel@gmail.com>
*/
@Entity
@Table(uniqueConstraints = {@UniqueConstraint(name = "uniqueWithInherited", columnNames = {"room", "cost"} )})
@Table(uniqueConstraints = {@UniqueConstraint(name = "uniqueWithInherited", columnNames = {"room_id", "cost"} )})
public class House extends Building {
public Long id;