If you want to treat all objects "equally", they all have to have common
oid field. You can do that by having single persistable base class, but I
don't think that's "necessary".
|---------+--------------------------->
| | battjt |
| | <[EMAIL PROTECTED]|
| | ign.net> |
| | |
| | 05/28/2003 07:06|
| | PM |
| | Please respond |
| | to "OJB Users |
| | List" |
| | |
|---------+--------------------------->
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: OJB Users List <[EMAIL PROTECTED]>
|
| cc:
|
| Subject: Re: global oid
|
|
|
>--------------------------------------------------------------------------------------------------------------------------------------------------|
java.lang.Object doesn't have an ID field. Are you suggesting that I
change my datamodel to have a single peristable super class?
Joe
[EMAIL PROTECTED] wrote:
>What you need to do, is create a class-descriptor that describes "Object",
>and all it's persistent derivative objects. Then OIDs are unique across
>the whole system, and more imporantly when you load an Object.class with
>OID 5, it will know it has to look at all the tables to find it.
>
<removed huge sig>
>Then how do I convert '5' into an object? Don't I still need to use a
>org.apache.ojb.broker.Identity? How do I allocate an Identity if I don't
>know the class?
>
>Joe
>
>
>Lance Eason wrote:
>
>
>>Just add an attribute "globalSequenceId" with a value of "true" to the
>>
>>
>entry for the sequence manager in your repository file.
>
>
>> <sequence-manager className
>>
>>
>="org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl">
>
>
>> <attribute attribute-name="grabSize" attribute-value="20"/>
>> <attribute attribute-name="globalSequenceId" attribute-value
>>
>>
>="true"/>
>
>
>> </sequence-manager>
>>
>>-----Original Message-----
>>From: battjt [mailto:[EMAIL PROTECTED]
>>Sent: Wednesday, May 28, 2003 1:06 PM
>>To: OJB Users List
>>Subject: global oid
>>
>>
>>I'm still trying to port our applications from Poet to OJB.
>>
>>Poet has a concept of an object ID, OID. I added the id as a field on
>>each of our objects and map that to the ID column from Poet. The
>>problem is that the OID is global. Given a long, Poet returns an
>>Object. 'Identity's in OJB are not global, but instead scoped to a
>>class. Anyone have a pattern to work around this?
>>
>>(Possible I'm just completely lost. I was using Longs for my ids, but
>>org.apache.ojb.jdori.sql.OjbStoreManager.getPCClassForOid was throwing a
>>class cast exception, so I assumed that I needed to use
>>org.apache.ojb.broker.Identity for my ids.)
>>
>>Thanks again,
>>Joe
>>
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]