• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamic Schema Name in hibernate @Formula Annotation

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic