Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] quickly getting a list of Entites

Hi Tom,

We are wondering if the delay on your first access is related to our plugins being (lazily) loaded, in addition to filling the model. What type of delay are you seeing with your first query for the entities?

I'm hoping that a model fill for 3 entities would be pretty quick, but if it also requires plug-in initialization, that could be the cause of the delay. You might need to prime the plugins at an earlier point to get a better response in your UI, but this is just a theory.

Neil

Tom Mutdosch wrote:

Hi guys,

I know this was sort of brought up before, but this is a bit of a variant :) I am interested in (quickly) getting a list of available Entities in a Project.

I am currently using:
JpaModelManager.instance().getFilledJpaProject(project)

And then asking the JPAProject for all of its entity types. The issue here is that calling this method can take a very long time to complete the first time it is called, even for a small number of entities (I have 3 in my project).

Since I am only interested in displaying available Entities and am not concerned with all of the model elements being initialized, I thought an alternative might be to avoid filling the entire JPAProject model, and instead get the list of entities from the persistence.xml's list of classes. I tried this:

IJpaProject jpaProject = JpaModelManager.instance().getJpaProject(project);

Collection<IJpaFile> persistenceXmlFiles = jpaProject.jpaFiles(PersistenceXmlJpaFileContentProvider.INSTANCE.contentType());

But I run into the problem that persistenceXmlFiles comes back as empty when I first call it (because the model is being updated in the background I assume). So my question is: is there any way I can get the persistence.xml's list of classes without having to have the entire JPA Model initialized? Or is there some way I can speed up the "filling" of the JPAModel (for example, not checking for entities not specified in the persistence.xml)?

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



Back to the top