-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: deny insert/update on lowest possible level
PostPosted: Tue Aug 08, 2006 12:56 pm 
Newbie

Joined: Tue Aug 08, 2006 12:43 pm
Posts: 1
Hello!

Ich am working on an application that uses Hibernate with a JDBC connection on Websphere Application Server.
The Application is mainly for displaying Data written to a DB2 on AS400 by a 3rd Party Application.

I need to be 100% sure, that my App is absolutely uncapable of modifying Data on the database.

Now at first i thought, that simply not giving the Database Objects any save() or update() methods would do the trick, but then i came across a little problem:

I hava a method that looks something like this:

Code:
public String getSomeProperty(){
   if(this.someProperty.equalsIgnorecase("foo") return "bar";
   return this.someProperty
}


calling this method causes Hibernate to run an UPDATE on the database, writing "bar" where there was "foo" before in the row corresponding to the object used.

I could of course use update="false" in all property mappings for all objects to avoid this on the base, but I was wondering if there was a way to avoid manipulation of data on a even lower level. Unfortunately I can not change the permissions that the useraccount of the application has to the database, so I need to restrict access on application level.

Is there any way to make hibernate uncapable of inserting and updating?
IF I'd use update="false", would it _quarantee_ that no updates are ever possible to that property?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 1:02 pm 
Expert
Expert

Joined: Tue Apr 25, 2006 12:04 pm
Posts: 260
Provide <class> element has mutable="false" attribute. Check this link http://www.hibernate.org/hib_docs/v3/re ... tion-class


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.