For posterity, overriding the single method worked, but I had to do two
other things:

1) Change the internal OJB descriptors such that the jdbc-type was a BIGINT
instead of an INTEGER.
2) Changed the OJB_HL_SEQ schema such that the max_key column was created
as a bigint instead of an int.

I seeded the OJB_HL_SEQ table with a record having a max_key value of
$F0000000 (in decimal form) and everything worked as expected.  Far easier
than I expected.  :-)

"Sean Dockery" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am working with a content-heavy database application that uses OJB
1.0RC5
> on SQL Server 2000.  Because the content is part of the value-proposition
> for customers to purchase our application, we would like a means of
easily
> identifying what (template) data came from us versus what data was
created
> by customers during their use of the application.
>
> The hope is that we can have a primarykey of a VARCHAR type that contains
> the hexadecimal format of the uniqueID issued by the HighLow sequence
> manager implementation.  For example, our customer records would begin at
> $F0000000 for records that they create.  Everything from $00000000 to
> $EFFFFFFF would be part of our template data.
>
> I have the source code to the version of OJB that we're using, but I am
> unsure where I should make the change?  Can I get away with just
> sub-classing SequenceManagerHighLowImpl and overriding the getUniqueValue
> method?
>
> Here's the implementation that I had been thinking of...
>
> public Object getUniqueValue(FieldDescriptor field) throws
> SequenceManagerException {
>     Object value = super.getUniqueValue(field);
>     if ("VARCHAR".equals(field.getColumnType())) {
>         value = Long.toString(Long.parseLong(value.toString()), 16);
>     }
>     return value;
> }
>
> There are tables in the application which use the hi/lo manager for
> legitimate integer unique ids; I don't want to interfere with that
> operation.
>
> Any comments?
>
> Thanks in advance for your help.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to