dbTalk Databases Forums  

Question about JPublisher ...

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss Question about JPublisher ... in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andreas Leitgeb
 
Posts: n/a

Default Question about JPublisher ... - 09-02-2011 , 09:55 AM






We've got a pl/sql package, which defines a couple of records:

create or replace package foo.bar is
type snafu is record (
sf_col1 varchar2(42),
);
type blarg is record (
bg_col1 varchar2(42),
);

We use JPublisher to create Java classes for this package, and
*sometimes* it (unrequestedly) merges two of the records into
one (Java-)class, which then has (e.g.) both sfCol1 and bgCol1.

When this happens, the created plsql_wrapper.sql also shows
those merged records - so whatever goes wrong, it seems to go
wrong right at the start...

How does JPublisher extract the information from the DB, that it
needs to create its output? And what could cause it to "randomly"
merge records?

PS: oracle 10.2.0

Reply With Quote
  #2  
Old   
Robert Klemme
 
Posts: n/a

Default Re: Question about JPublisher ... - 09-04-2011 , 06:47 AM






On 09/02/2011 04:55 PM, Andreas Leitgeb wrote:
Quote:
We've got a pl/sql package, which defines a couple of records:

create or replace package foo.bar is
type snafu is record (
sf_col1 varchar2(42),
);
type blarg is record (
bg_col1 varchar2(42),
);

We use JPublisher to create Java classes for this package, and
*sometimes* it (unrequestedly) merges two of the records into
one (Java-)class, which then has (e.g.) both sfCol1 and bgCol1.

When this happens, the created plsql_wrapper.sql also shows
those merged records - so whatever goes wrong, it seems to go
wrong right at the start...

How does JPublisher extract the information from the DB, that it
needs to create its output? And what could cause it to "randomly"
merge records?

PS: oracle 10.2.0
Just guessing here: both records have the exact same structure (i.e.
same order of elements with identical types) - maybe JPublisher is
figuring that both are structurally equivalent and lumps them together.

Side note: I would at least consider whether it's a good practice to
define two types with identical structure because they *are* equivalent.

Kind regards

robert

Reply With Quote
  #3  
Old   
Andreas Leitgeb
 
Posts: n/a

Default Re: Question about JPublisher ... - 09-04-2011 , 01:03 PM



Robert Klemme <shortcutter (AT) googlemail (DOT) com> wrote:
Quote:
On 09/02/2011 04:55 PM, Andreas Leitgeb wrote:
We've got a pl/sql package, which defines a couple of records:

create or replace package foo.bar is
type snafu is record (
sf_col1 varchar2(42),
);
type blarg is record (
bg_col1 varchar2(42),
);
We use JPublisher to create Java classes for this package, and
*sometimes* it (unrequestedly) merges two of the records into
one (Java-)class, which then has (e.g.) both sfCol1 and bgCol1.
When this happens, the created plsql_wrapper.sql also shows
those merged records - so whatever goes wrong, it seems to go
wrong right at the start...
How does JPublisher extract the information from the DB, that it
needs to create its output? And what could cause it to "randomly"
merge records?
PS: oracle 10.2.0
Just guessing here: both records have the exact same structure
Sorry, this guess didn't hit.
One of the structures has 59 elements, the other has 61 elements,
and the Java struct (as well as the one in plsql_wrapper.sql) has 120

Quote:
maybe JPublisher is figuring that both are structurally equivalent
and lumps them together.
Even if it *were* so, it wouldn't then make sense to lump them together
such, that all the duplicate elements among the actual db records
would then show up *doubly* in the created structs, would it?

Quote:
Side note: I would at least consider whether it's a good practice to
define two types with identical structure because they *are* equivalent.
Even though merely theoretical, I do not agree to that position.
If they have a different use, then they may easily have a different
future, too. If you merge them now, you'll likely have to re-separate
them, if one of the uses needs a change, lateron. Also, the fields may
mean different things (despite being of same types) and probably reflect
their specific meaning by different field names. Replacing two such
structures with a single one (with generic or misleading names then),
is most likely a bad idea.

PS: but thanks, anyway, for answering.

Reply With Quote
  #4  
Old   
Robert Klemme
 
Posts: n/a

Default Re: Question about JPublisher ... - 09-05-2011 , 01:40 PM



On 04.09.2011 20:03, Andreas Leitgeb wrote:
Quote:
Robert Klemme<shortcutter (AT) googlemail (DOT) com> wrote:
On 09/02/2011 04:55 PM, Andreas Leitgeb wrote:
We've got a pl/sql package, which defines a couple of records:

create or replace package foo.bar is
type snafu is record (
sf_col1 varchar2(42),
);
type blarg is record (
bg_col1 varchar2(42),
);
We use JPublisher to create Java classes for this package, and
*sometimes* it (unrequestedly) merges two of the records into
one (Java-)class, which then has (e.g.) both sfCol1 and bgCol1.
When this happens, the created plsql_wrapper.sql also shows
those merged records - so whatever goes wrong, it seems to go
wrong right at the start...
How does JPublisher extract the information from the DB, that it
needs to create its output? And what could cause it to "randomly"
merge records?
PS: oracle 10.2.0
Just guessing here: both records have the exact same structure

Sorry, this guess didn't hit.
One of the structures has 59 elements, the other has 61 elements,
and the Java struct (as well as the one in plsql_wrapper.sql) has 120
That wasn't obvious from your first posting.

Quote:
maybe JPublisher is figuring that both are structurally equivalent
and lumps them together.

Even if it *were* so, it wouldn't then make sense to lump them together
such, that all the duplicate elements among the actual db records
would then show up *doubly* in the created structs, would it?
No, but it could be a bug in a corner case.

Quote:
Side note: I would at least consider whether it's a good practice to
define two types with identical structure because they *are* equivalent.

Even though merely theoretical, I do not agree to that position.
If they have a different use, then they may easily have a different
future, too. If you merge them now, you'll likely have to re-separate
them, if one of the uses needs a change, lateron. Also, the fields may
mean different things (despite being of same types) and probably reflect
their specific meaning by different field names. Replacing two such
structures with a single one (with generic or misleading names then),
is most likely a bad idea.
Yeah, I considered that as well that's why I didn't write "it's bad
practice" but rather "consider whether it's a good practice". More like
a warning sign.

Quote:
PS: but thanks, anyway, for answering.
You're welcome!

Kind regards

robert


--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Reply With Quote
  #5  
Old   
Andreas Leitgeb
 
Posts: n/a

Default Re: Question about JPublisher ... - 09-06-2011 , 06:22 AM



Robert Klemme <shortcutter (AT) googlemail (DOT) com> wrote:
Quote:
On 04.09.2011 20:03, Andreas Leitgeb wrote:
Robert Klemme<shortcutter (AT) googlemail (DOT) com> wrote:
On 09/02/2011 04:55 PM, Andreas Leitgeb wrote:
We've got a pl/sql package, which defines a couple of records:
create or replace package foo.bar is
type snafu is record (
sf_col1 varchar2(42),
);
type blarg is record (
bg_col1 varchar2(42),
);
We use JPublisher to create Java classes for this package, and
*sometimes* it (unrequestedly) merges two of the records into
one (Java-)class, which then has (e.g.) both sfCol1 and bgCol1.
Just guessing here: both records have the exact same structure
Sorry, this guess didn't hit.
One of the structures has 59 elements, the other has 61 elements,
and the Java struct (as well as the one in plsql_wrapper.sql) has 120
That wasn't obvious from your first posting.
Indeed, I didn't (and still don't) find this information relevant.
JPublisher adds a wrong record's fields to the wanted record's fields,
so it didn't occur to me that this could possibly be a buggy attempt
at *unifying records* in the first place.

As it happened, the two original records even had two fields in common
(same field name and type in both records, the other fields being
different), and these two showed up doubly in the generated Java class,
which caused the Java compiler to barf on it, which again made us notice
it, because we didn't actually use this particular record. (it only gets
generated as a byproduct when we need other parts of that plsql-package)

I had hoped for someone recognizing some bug of JPublisher (and perhaps
the oracle-release by which this would be fixed).
Googling (and I did a lot of it) didn't show anything relevant, but then
again, Google doesn't seem to have oracle's bug-database in its index.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.