Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

manipulating xml files at runtime

 
suchu sanghi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i have a team.hbm.xml file which contains the mappings for my database table.

right now this file contains 3 properties as per my table.

but now my requirement is that when a player logs in, he can access these three properties but when my manager logs in, he has an access to additional columns of the same table.

is there any way that at runtime, i can add properties to my already existing team.hbm.xml file? Similar to something what "org.hibernate.cfg.Configuration" does to the hibernate configuration file.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, mapping files are just XML so it is perfectly possible to manipulate them via Java. Of course if you did this you would need to recreate the SessionFactory.

A better solution might be to just create two mapped objects - Team and ManagedTeam - and control access to these via whatever authorization mechanism you use.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic