Most of the posts I have read on this error refer to errors in not using aliases or thinking that the database table column name should be used rather than the mapped class property name.
Neither simple case is causing my error, as I understand it.
Error from trace:
could not resolve property: idCharacterTable
code snippet:
Code:
//Create Select Clause HQL
Query query = session.createQuery("select charac.idCharacterTable, charac.FirstName from CharacterTable charac");
for(Iterator<CharacterTable> it=query.iterate();it.hasNext();){
CharacterTable row = (CharacterTable) it.next();
System.out.println("Name: " + row.getFirstName());
}
class code:
Code:
private int idCharacterTable;
@Id
@Column(name = "IDCHARACTERTABLE", unique = true, nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
public int getIdCharacter() {
return idCharacterTable;
}
public void setIdCharacter(int characterTableId) {
this.idCharacterTable = characterTableId;
}
Since the class property, the annotation name attribute, and database table are named the same what can possibly be wrong here?