Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
amir hosein khanof  
View profile  
 More options Oct 7, 8:40 pm
From: amir hosein khanof <amir.kha...@gmail.com>
Date: Wed, 7 Oct 2009 14:10:45 +0330
Local: Wed, Oct 7 2009 8:40 pm
Subject: which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)

Dear All,

I want to bring a new discussion about standard way of implementing PK in
ADF.
I always use DBSEquece for primary key but many are using another way that
is:
uncheck the mandatory field for the attribute with primary-key in the EO,and
ADF in working with null value in pk and suprisingly it is working!
Is the second method ok? I test it and it seems that it is working!
if the second method is ok! so why adf has DBSequence??.
In both way of course the generated pk is from Pre-Insert trigger in the
Oracle.
Can anybody tell me what is the cons and pros of each method?

Thanks and regards,
Amir


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrejus Baranovskis  
View profile  
 More options Oct 7, 8:50 pm
From: Andrejus Baranovskis <andrejus.baranovs...@gmail.com>
Date: Wed, 7 Oct 2009 13:50:47 +0300
Local: Wed, Oct 7 2009 8:50 pm
Subject: Re: [ADF Enterprise Methodology Group] which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)

Hi,
DBSequence pre-populates new record with negative key value. If you will
have Master-Detail, and will create records in Detail same time, this
temporary value will be assigned to Detail records. After commit, temporary
values will be refreshed with sequence value.

If you uncheck mandatory field for primary key attribute, its a bad practice
- key attribute will not be validated in ADF BC Model.

Andrejus

2009/10/7 amir hosein khanof <amir.kha...@gmail.com>

--
Oracle ACE Director

My Blog - http://andrejusb.blogspot.com/
My JDev/ADF Samples list - http://andrejusb-samples.blogspot.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
amir hosein khanof  
View profile  
 More options Oct 7, 9:22 pm
From: amir hosein khanof <amir.kha...@gmail.com>
Date: Wed, 7 Oct 2009 14:52:26 +0330
Local: Wed, Oct 7 2009 9:22 pm
Subject: Re: [ADF Enterprise Methodology Group] Re: which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)

Dear Andrejus,

Thanks for your reply, in the second way is there any case that does not fit
or result in error?
As I have tested in all cases it is ok.

Thanks
Amir

On Wed, Oct 7, 2009 at 2:20 PM, Andrejus Baranovskis <


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrejus Baranovskis  
View profile  
 More options Oct 7, 11:26 pm
From: Andrejus Baranovskis <andrejus.baranovs...@gmail.com>
Date: Wed, 7 Oct 2009 16:26:44 +0300
Local: Wed, Oct 7 2009 11:26 pm
Subject: Re: [ADF Enterprise Methodology Group] Re: which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)

Hi Amir,
That right - it works. But if you remove Mandatory option, action will
propogate to DB level and only DB will return error about missing primary
key value (in a case if someone will try to commit empty key). So, its bad
design, this should be catched in Model layer.

There is another alternative to DBSequence - you can access DB sequence in
overriden Entity create (method). You can assign negative sequence there and
on actual commit in doDML change it to real positive sequence. There is no
need in DB triggers then. But, I would recommend to use DBSequence - its
especially good in Master-Detail CRUD.

Andrejus

2009/10/7 amir hosein khanof <amir.kha...@gmail.com>

--
Oracle ACE Director

My Blog - http://andrejusb.blogspot.com/
My JDev/ADF Samples list - http://andrejusb-samples.blogspot.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Koniotiakis  
View profile  
 More options Oct 8, 2:39 am
From: Michael Koniotiakis <mko...@hotmail.com>
Date: Wed, 7 Oct 2009 09:39:05 -0700 (PDT)
Local: Thurs, Oct 8 2009 2:39 am
Subject: Re: which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)
If you have null PK value on Entity you will have problems.

Try the following
have a Master-detail view objects
Create 2 rows on master and dont post (use optimistic locking)
navigate to 1 row and create a detail row
You will have problem for sure since the detail cannot distinguish to
which master it belongs.

I also dont like DBSequence since it works only for Oracle Database
(SQL server dont have sequence)

I prefer to use a method in the base view object class to populate the
primary key either from DBSequence for oracle or other objects for
other databases/

On 7 Οκτ, 14:22, amir hosein khanof <amir.kha...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Haslam  
View profile  
 More options Oct 8, 3:00 am
From: Simon Haslam <Sim...@veriton.co.uk>
Date: Wed, 7 Oct 2009 10:00:10 -0700 (PDT)
Local: Thurs, Oct 8 2009 3:00 am
Subject: Re: which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)
Shouldn't the logic be in the entity object rather than the view
object though? That would be the logical place from an abstraction
perspective (and why there is the DBsequence option in the EO
settings) IMO. I don't know about other databases though.

Simon

On Oct 7, 5:39 pm, Michael Koniotiakis <mko...@hotmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Avrom Roy-Faderman  
View profile  
 More options Oct 8, 11:04 am
From: Avrom Roy-Faderman <av...@avromroyfaderman.com>
Date: Wed, 7 Oct 2009 18:04:10 -0700 (PDT)
Local: Thurs, Oct 8 2009 11:04 am
Subject: Re: which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)
Just to be specific here, the issue isn't that DBSequence requires
such a thing as a database sequence (it doesn't; nowhere in the code
does it check to make sure a Sequence exists, and the Sequence
metadata you can enter is only for forward-generation; it's not used
by the runtime) but rather that standard SQL doesn't have a RETURNING
clause for DML, and that ADF BC therefore doesn't support *any*
Refresh After... settings for non-Oracle DBs.

In some deep sense, the "right" place to override this is in a
SQLBuilder implementation, specifically
SQLBuilder.supportsReturningClause(), SQLBuilder.buildInsertStatement
(), SQLBuilder.bindInsertStatement(), and
SQLBuilder.doLoadFromStatement(). That would let you support arbitrary
refresh on insert attributes.

On Oct 7, 9:39 am, Michael Koniotiakis <mko...@hotmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Koniotiakis  
View profile  
 More options Oct 8, 6:49 pm
From: Michael Koniotiakis <mko...@hotmail.com>
Date: Thu, 8 Oct 2009 01:49:30 -0700 (PDT)
Local: Thurs, Oct 8 2009 6:49 pm
Subject: Re: which method is standard for primary-key in ADF 11g? (DBSequence or uncheck mandatory for PK in EO)
Yes sory it was a Typo. Of course in Entity object

On 7 Οκτ, 20:00, Simon Haslam <Sim...@veriton.co.uk> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google