Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I access specific schemas in hibernate spring?

I use Hibernate-Spring and I am trying to access a specific schema in a db but don't know how. The name of the table is not doing the trick. I was hoping that annotation would help be but it hasn't so far. Note: I am not trying to create a schema, I just want to access it. I use Spring 2.5.

like image 736
why_vincent Avatar asked Feb 22 '23 16:02

why_vincent


1 Answers

Set schema in your mappings:

@Table(name="myentity", schema="some")

<class name="MyEntity" table="myentity" schema="some">

or use default:

hibernate.default_schema="some"
like image 163
Mikko Maunu Avatar answered Feb 25 '23 06:02

Mikko Maunu