• Post Reply Bookmark Topic Watch Topic
  • New Topic

make db table read only

 
Madhu Sudhana
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I make a table in database read only making use of hibernate?

is there any property in hbm.xml file so that I can say that this table is read only.....?
 
Paras Jain
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can set mutable="false" in the hbm mapping file
 
Madhu Sudhana
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for reply

and I found this statement in Hiberbate reference document......

Immutable classes, mutable="false", may not be updated or deleted by the application. This allows Hibernate to make some minor performance optimizations.

so then I have restrict insertions also.......

how can I proceed?
 
Paras Jain
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Immutable classes, mutable="false", may not be updated or deleted by the application. This allows Hibernate to make some minor performance optimizations.

so then I have restrict insertions also.......


Yes, with mutable="false" you can restrict updation and deletion. But you can do insertions. That is what you want to achieve right?

how can I proceed?

what do you want to do next.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!