-->
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.  [ 6 posts ] 
Author Message
 Post subject: Read-only entities
PostPosted: Wed May 31, 2006 5:36 am 
Beginner
Beginner

Joined: Wed Apr 26, 2006 4:12 am
Posts: 29
I have a mapping with all properties set to Insert=false and Update=false because I don't want to produce any SQL for this class as it just holds read-only info. However, SQL is always produced for the ID. How can I prevent this?


Top
 Profile  
 
 Post subject: Re: Read-only entities
PostPosted: Wed May 31, 2006 5:44 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
davidceder wrote:
I have a mapping with all properties set to Insert=false and Update=false because I don't want to produce any SQL for this class as it just holds read-only info. However, SQL is always produced for the ID. How can I prevent this?


You can add to mapping
Code:
<class ..
mutable="false">


This should prevent all update statements (I have not tried). However, I have no idea how to avoid insert statements...

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 5:51 am 
Beginner
Beginner

Joined: Wed Apr 26, 2006 4:12 am
Posts: 29
Unfortunately, it is really inserts I need t prevent.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 5:52 am 
Beginner
Beginner

Joined: Wed Apr 26, 2006 4:12 am
Posts: 29
Unfortunately, it is really inserts I need t prevent.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 10:04 am 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
how do you have the entity's "id" field mapped? do you have the "unsaved-value" set?

-devon


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 10:24 am 
Beginner
Beginner

Joined: Tue May 30, 2006 10:55 am
Posts: 21
Have you tried to set the id generator to assigned?
Code:
<id name="Id" column="LogonId" type="String" length="20">
            <generator class="assigned" />
        </id>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.