• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic Schema Name in hibernate @Formula Annotation

 
Cory Max
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone... wow am I stumped.

As our project begun, we considered the question of annotations vs xml files, researched and decided on annotations. This so far has worked out fine (1+ years on large project). Recently we decided to use oracle proxy users.

If you don't know what that means, don't worry... just know that part of the requirement for proxy users is that every sql query must have schema_name.table_name in its queries.

My problem is this: In our Entity classes, we have many @Formula annotations doing things like selecting counts of other tables, etc. Inside these @Formula annotations is plain regular sql. I can easily put the schema name in the formula, but our deployment group needs the schema name to be configurable. This is bad because you can not change an annotation once it has been compiled, so to do a new deployment to a new environment that uses a new schema, we need to change all formulas, rebuild, package and deploy. This isnt acceptable to them so I need to find a solution.

Does anyone have any ideas? I'm really, really stumped.

Thanks,

Yeuker
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic