Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] Attribute type

I'm not sure why this would be difficult to put on PersistentAttribute.... ?

Maybe not:
     persistentAttribute.getAttribute()
which seems to be a very java-ish thing, but certainly:
    persistentAttribute.getJavaType()
or something like that would be possible, especially because even for XML we'd need it.

- Paul


Karen Moore wrote:

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

 


From: dali-dev-bounces@xxxxxxxxxxx [mailto:dali-dev-bounces@xxxxxxxxxxx] On Behalf Of Dirk le Roux
Sent: Thursday, February 02, 2006 12:27 PM
To: General Dali EJB ORM developer discussion.
Subject: [dali-dev] Attribute type

 

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


_______________________________________________ dali-dev mailing list dali-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/dali-dev

Back to the top