Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] FW: Get all entities from the project

Hi Dimiter,

We don't currently have api for this in 0.5 and I would recommend opening an enhancement request against 1.0 to include this as api.  In 0.5 your best bet is to call PersistenceProject.persistenceFiles().  This will return you an iterator of PersistenceFile objects. Then PersistenceFile.getPersistentTypes will return the Collection of PersistentTypes.  Each PersistentType has a TypeMapping on it which can be Entity, MappedSuperclass, Embeddable.  You can use PersistnentType.getTypeMappingKey() and compare it to Entity.Key.INSTANCE to check if it is an Entity. 

This has changed some in 1.0 and we need to have api for it (even if it is provisional or internal for now).  I hope this helps you.

Karen


Dimitrov, Dimiter wrote:
FW: Get all entities from the project

Hello,

I want to obtain all entities from the specified JPA project (Dali 0.5). I could do it as it is done in org.eclipse.dali.db.ddl.DDLGenerator in the following private methods:

private Collection buildPersistenceFiles();
private void addPersistenceFilesTo(PersistenceContainer container, Collection files);
private void addPersistenceFilesTo(PersistenceResource resource, Collection files));
But I'm wondering whether is possible to do it in more elegant and convenient way - I mean is there some official API, intended for this purpose?

Thank you in advance and Best Regards,
Dimiter


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

Back to the top