You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running SampleCode test on H2 database generates the following error
No such field: ID
in the call
List<Name> list = db.where("firstName=?", "John").results(Name.class);
The problem is, that H2 follows strong the ANSI definition, that unquoted column names are returned in the metadata queries in uppercase. I found discussions with the H2 author regarding metadata format here and here.
The workaround is
Annotate each column with uppercase name
@Id
@GeneratedValue
@Column(name="ID")
public long id;
For H2 you can use specific JDBC URL option database_to_upper=false. However, the database must be dropped and re-created, the workaround does not work on existing DB.
I do not know if I should classify this as a bug, anyway, the current behavior is not ANSI conform. On the other side, ANSI metadata handling probably breaks MySql or Postgres API.
No idea where to start to hunt the bug., but IMO it should be solved.
Robert
The text was updated successfully, but these errors were encountered:
Running SampleCode test on H2 database generates the following error
in the call
List<Name> list = db.where("firstName=?", "John").results(Name.class);
The problem is, that H2 follows strong the ANSI definition, that unquoted column names are returned in the metadata queries in uppercase. I found discussions with the H2 author regarding metadata format here and here.
The workaround is
database_to_upper=false
. However, the database must be dropped and re-created, the workaround does not work on existing DB.I do not know if I should classify this as a bug, anyway, the current behavior is not ANSI conform. On the other side, ANSI metadata handling probably breaks MySql or Postgres API.
No idea where to start to hunt the bug., but IMO it should be solved.
Robert
The text was updated successfully, but these errors were encountered: