cancel
Showing results for 
Search instead for 
Did you mean: 

One Class in two JavaBean Models....

Former Member
0 Kudos

Hi all

I'm really mad at this point, probably you have faced this problem:

We are using some basic classes for our application like an adress or a KeyValue class.

Unfortunately the java bean Model does not accept two models using the same class.

Which I don't really understand

I thought I can use some interfaces to trick Java Bean Model:

Basic class implements IBasic interface, for model A I created class BasicA, which implemente IBasicA, the class is just a dummy, referring all calls to Basic, IBasicA is extending IBasic, no more decalration here. The same applies to IBasicB and BasicB

But: Java Bean Model does not accept that, because BasicA and BasicB do not have the fields like Basic does...

So is the only way to copy classes for reuse! It's terrible that way, maybe I don't know the jedi way.

using 2004 SP19

Thanks in advance

Stefan

Accepted Solutions (0)

Answers (2)

Answers (2)

monalisa_biswal
Contributor
0 Kudos

Yes, Same situation i had faced during one project.

One workaround is to remove that particular class from the import list.

After import is over, instead of model node you will have an attribute of that class type .You can do rest of data handling with this attribute.

Former Member
0 Kudos

Instead of using interfaces, have you tried declaring your fields and associated getters/setters directly in Basic class, then have BasicA and BasicB simply extend Basic ?