Hi Dirk,
We have code
for this, but currently it’s
in 2 separate places and not where you can use it. We either duplicate
that code in a 3rd place or we clean it up now for you to
have access
to it. You can get to the appropriate object by calling
PersistentAttribute.getModelAdapter().
Cast the IPersistentAttributeModelAdapter to a
JavaPersistentAttributeModelAdapter and call getAttribute(). From
AbstractAttribute you can get a hold of the JDT IMember, IField,
IMethod, or IType.
We have code
that does what you need in
JavaBasicModelAdapter.defaultApplies() and
JavaReferencePersistentAttributeFlavorModelAdapter.javaDefaultTargetEntity().
Now while I don’t want to advocate cut and paste, that might be the
simplest thing right now for completion of this iteration. Then we
need
to make this a new task for the next iteration to clean this up and put
the
code in a place that makes sense for use in all 3 locations. Anyone
else have
suggestions?
Karen
Hi All,
How do I get the type of an attribute (eg. int for: private int id; or
public
int getId();) starting from a PersistentAttribute (got it from
PersistentType.getPersistentAttributes())?
Dirk le Roux