Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Partial Save requirement

Thread view: 
mroman - 04 Mar 2007 21:43 GMT
Hi all, maybe someone can help me with this problem.

We have a new requirement for our application: a partial save button
for a form.

We have a form, where the client can save a new 'Account" (an
'Account' in our model is a very big object graph with a lot of
'child' objects. An Account has Items, an Item has Deparments, and so
on).
We do this mapping our objects to a relational database using
Hibernate. In the database we have a lot 'not null' fields amd foreing
keys.

Now we need a partial save, so the client may not fill the entire
form, and save it.
So, we can't use the same object model and domain model, because we
have this 'not null' and foreing keys that now can be incomplet.

Our options right now are:

1 - Duplicate object and database model.
    For every object that could be partial saved, we need another
'draft object' and a new table in the database (eg. Account ->
AcountDraft mapped to ACCOUNT_DRAFT in the database).

2 - Replace all the 'not nulls' and foreing keys for database
constrains and use a flag field in the objects.

Does anybody have a better idea?

Thanks.
villo - 05 Mar 2007 11:36 GMT
Hi

not sure, but given that your domain model allows it
you could create a statically persisted account object,
where all the references are satisfied.
Anyway if the account's state supports a wider range of
processes, you may want to explicitly include it in the
data model.
hope this helps...

Francesco

> Hi all, maybe someone can help me with this problem.
>
[quoted text clipped - 27 lines]
>
> Thanks.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.