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.  [ 4 posts ] 
Author Message
 Post subject: newbie to hibernate. only needs to update, never read
PostPosted: Thu Dec 01, 2005 6:07 pm 
Newbie

Joined: Thu Dec 01, 2005 5:58 pm
Posts: 10
is there anyway i can only write to a table and never retrieve from that table?

my current tables

table: person
personid
personname
personaddress

table: party
partyid
partyname
partylocation

table: partyperson
partypersonid
partyid
personid

table: currentpartyperson
partypersonid
partyid
personid

the difference between currentpartyperson and partyperson table is that partyperson have 10000 rows of record and while currentpartyperson only have one row of last person.

right now in my party have two list of person and currentperson. when i load the application, they load all the table info in. however, i don't need the information from partyperson, i only need to write to this table. hopefully, i explain my problem clearly. thanks to anyone who can offer me some help.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 6:40 pm 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
Your application never needs to read those tables?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 7:05 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
So long as partyperson doesn't need to be read to figure out its primary key, it should be fine. So if partypersonid is an identity, or has a default value like newId(), then you'll be fine. You can add a little hibernate-checked safety net by making all attributes in your partyperson table update="false", seeing as you're only ever going to insert into the table.

You may find that you don't need to map partyperson at all. Database triggers that create a partyperson row whenever a currentpartyperson row is inserted or updated will probably work, they'll be faster than hibernate, and they'll reduce the amount of java code you have to maintain.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 01, 2005 7:54 pm 
Newbie

Joined: Thu Dec 01, 2005 5:58 pm
Posts: 10
my application only need to read from currentpartyperson. it never needs to read from partyperson.


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