I've encountered a behaviour of javax.persistence.EntityManager I'd like to understand.
I had code similar to the following:
1 // Query Execution
2 EntityManager emext;
3 String query = "SELECT obj FROM MyDatabaseTableBE obj obj.FOO = :fooName)";
4 Query q = emext.createQuery(query);
5 // Corresponding BE
6 ...
7 public static final String FOO = "fOO";
8 ...
9 @AttributeMetadata(attributeNature = AttributeNature.REGULAR)
10 @SearchAttributeMetadata(searchable = false)
11 private String foo;
12 ...
13 public String getFOO() {
14 return foo;
15 }
16 ...
17 public void setFOO(final String foo) {
18 this.foo = foo
19 }
20 ...
throwing the following exception: could not resolve property: fOO of: MyDatabaseTableBE in line 4.
The only thing I changed was the capitalisation:
// Corresponding BE, with changed capitalisation
...
public static final String FOO = "foo";
...
public String getFoo()
...
public void setFoo(final String fOO)
...
And it worked without an exception.
Why did the first version (with the second and third character in uppercase) not work?