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