Using property file in hibernate mapping
-
25-09-2019 - |
문제
I have a two nodes environment using the same database. In the database there is a resource table like
RESOURCE_ID,
CODE,
NODE
The content of the NODE column can be 1 or 2 depending on which node can use it. As I need to deploy the same ear to the two nodes, I would like to map this table like this:
<hibernate-mapping>
<class name="ResourceVO" table="RESOURCE"
dynamic-update="true" optimistic-lock="dirty" where="NODE=${node.value}" >
I would like to store the node.value property on the file system, so the instances could identify which resource to use. Is it possible in hibernate?
해결책
AFAIK, Hibernate doesn't offer any support for this and I would personally use a build tool (Ant, Maven) here, they both have filtering capabilities. See for example the chapter 9.3. Resource Filtering in the Maven Book for Maven.
제휴하지 않습니다 StackOverflow