Reputation: 2760
I made a simplified example of the same problem that I can't solve on a bigger project.
The simplified project is here (play with it): https://gitlab.com/tyvain/h2bug
Description - using H2 mem database:
A simple entity with a schema can be access without problem from a jpa repo:
@Entity
@Table(name = "SCOLARITE.VOITURE")
But a immutable entity can't:
@Entity
@Immutable
@Subselect("SELECT DISTINCT ID FROM SCOLARITE.VOITURE")
Table "VOITURE" not found; SQL statement:
select voiturevie0_.id as id1_0_ from ( SELECT DISTINCT ID FROM SCOLARITE.VOITURE )
You can find the test that reproduce the error in the gitlab project.
What can I do to solve this ?
Upvotes: 0
Views: 268
Reputation: 36223
Your Table annotation is wrong. You can't specify the schema in the name attribute. You have to use the schema attribute:
@Table(name = "VOITURE", schema = "SCOLARITE")
Upvotes: 1