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 Neil/etc, don't mean to hijack this thread, but I have a couple of 
related questions:

1) What is the best way to acquire a list of all valid orm mapping files 
in the project? I.e. something similar to 
jpaProject.getPlatform().validPersistenceXmlFiles(). I've been using 
jpaProject.jpaFiles(JptCorePlugin.ORM_XML_CONTENT_TYPE) but it only seems 
to always return META-INF\orm.xml and doesn't include other orm files in 
META-INF or other places.

2) I've noticed that sometimes when bean classes get refactored (moved, 
changed in name), exceptions occur during jpa model re-synchs like 
below... at least on the RC0 based driver I'm using.  Not sure if this is 
known or a bugzilla needs to be opened? Wondering if it's timing issues 
where things go into an inconsistent state for a while when JDT is doing 
it's temparory shuffling-around work for renames or moves.

java.lang.RuntimeException: Java Model Exception: Java Model Status 
[TestBean.java [in com.test [in src [in JPA1]]] does not exist]
        at 
org.eclipse.jpt.core.internal.content.java.JavaPersistentType.superclassTypeSignature(
JavaPersistentType.java:872)
        at 
org.eclipse.jpt.core.internal.content.java.JavaPersistentType.refreshParentPersistentType(
JavaPersistentType.java:918)
        at 
org.eclipse.jpt.core.internal.content.java.JavaPersistentType.refreshDefaults(
JavaPersistentType.java:914)
        at 
org.eclipse.jpt.core.internal.platform.JavaTypeContext.refreshDefaults(
JavaTypeContext.java:57)
        at 
org.eclipse.jpt.core.internal.platform.JavaEntityContext.refreshDefaults(
JavaEntityContext.java:120)
        at 
org.eclipse.jpt.core.internal.platform.XmlTypeContext.refreshDefaults(
XmlTypeContext.java:206)
        at 
org.eclipse.jpt.core.internal.platform.MappingFileContext.refreshDefaults(
MappingFileContext.java:98)
        at 
org.eclipse.jpt.core.internal.platform.PersistenceUnitContext.refreshDefaults(
PersistenceUnitContext.java:241)
        at 
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext.refreshDefaults(
BaseJpaProjectContext.java:158)
        at 
org.eclipse.jpt.core.internal.platform.BaseJpaProjectContext.refreshDefaults(
BaseJpaProjectContext.java:151)
        at org.eclipse.jpt.core.internal.platform.BaseJpaPlatform.resynch(
BaseJpaPlatform.java:201)
        at org.eclipse.jpt.core.internal.JpaProject$1.run(
JpaProject.java:176)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Thanks,
Len.

------------------------------------------
Leonard Theivendra
Websphere / IBM Software Solutions Toronto
email: theivend@xxxxxxxxxx
tel: (905) 413-3777  tie: 969-3777
fax: (905) 413-4920





Neil Hauge <neil.hauge@xxxxxxxxxx> 
Sent by: dali-dev-bounces@xxxxxxxxxxx
06/05/2007 05:23 PM
Please respond to
neil.hauge@xxxxxxxxxx; Please respond to
"General Dali EJB ORM developer discussion." <dali-dev@xxxxxxxxxxx>


To
"General Dali EJB ORM developer discussion." <dali-dev@xxxxxxxxxxx>
cc

Subject
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

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




Back to the top