cancel
Showing results for 
Search instead for 
Did you mean: 

duplicate model property at extended java bean

Former Member
0 Kudos

Hello all!

I am using a java bean model. It contains classes which sometimes extend other classes.

After the import of java bean model, the model class has duplicate properties: one of the current class and one of the super class.

for example:

class Customer

field name

field moneySpent

class GoodCustomer extends Customer

field telephone

even though I do not overwrite the fields name/moneySpent the model class has 5 model relations:

name --->relation name Customer.Name

name --->relation name GoodCustomer.Name

moneySpent --->relation name Customer.MoneySpent

moneySpent --->relation name GoodCustomer.MoneySpent

telephone --->relation name GoodCustomer.Telephone

In the bind context view I can also see the five properties, so I am confused which one to really bind to the context...

I would prefer the GoodCustomer relations, is that correct??

Cheers

stefan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Geert,

I agree it is not very intuitive to have two model relations visible for the Inherited class.

One workaround is, incase you only need one relation of the two visible. Go to the

Model Editor of the Model Class by double clicking on the Model Class GoodCustomer. Go to the Relations tab and remove the relations

name --->relation name GoodCustomer.Name and

moneySpent --->relation name GoodCustomer.MoneySpent.

The Relations tab shows the origin of both the relations in the Target Role column within brackets. This will help you identify the unwanted relation and delete it.

However you can only delete relations from the sub class and not the super class.

I hope this helps.

Best Regards,

Nidhi Rajshree

Answers (1)

Answers (1)

Former Member
0 Kudos

Geert || Stefan,

This sounds like a bug.

However, never noticed this -- the inheritance was always handled correctly in my projects via JavaBean model import.

Btw, does wizard incorrectly handles properties or relations? Or both?

Probably you mapped extra-relations during import?

And, if you context node to bind model class -- do you see errors or extra attributes?

VS

Former Member
0 Kudos

I'm seeing the same thing (NWDS 7.0.09)... The import wizard is creating the inherited relations on both the super class and child class, resulting in duplicates showing up in the model class editor (if you show inherited) and during context binding (where you always see the inherited relations)... Using either set of relations on the child class works fine though (you just don't need the extras)...

Former Member
0 Kudos

Hi

We use NW2004 SP 19

@David, ok thanks

@VS when importing the model all classes have correct amount of attributes, it dows not have the properteis in the "Properteis" View of the model class, only in the tree view of the model... no errors on context binding, you are just abled to bind both attributes, I wonder hwat happens then

anyway, it's not a real error, it's just confusing

Stefan