Message: 2
Date: Wed, 05 Sep 2007 12:57:01 -0400
From: Karen Moore <karen.moore@xxxxxxxxxx>
Subject: Re: [dali-dev] Listening for Entity Generation operations
To: "General Dali EJB ORM developer discussion."
<dali-dev@xxxxxxxxxxx>
Message-ID: <46DEDFDD.4000305@xxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi Tom,
It seems that what you (and probably Chris as well) really want to do is
to run the wizard and the entity generation operation yourself. In the
generic platform we call
org.eclipse.jpt.ui.internal.generic.EntitiesGenerator.generate(IJpaProject,
IStructuredSelection). In here we run the GenerateEntitiesWizard and
then schedule the WorkspaceJob that generates the entities and
synchronizes the persistence.xml classes. You should probably be using
PackageGenerator.generateEntities() which takes an IProgressMonitor. I
would assume that you would copy a lot of the code in EntitiesGenerator
and change how the Job is run. Then you would be able to hook in at the
right moment to do your post-processing, probably before the
persistence.xml SynchronizeClassesJob is run. Look at the code in
EntitiesGenerator.GenerateEntitiesRunnable.runInWorkspace(IProgressMonitor).
I would expect your code to come after the call to
PackageGenerator.generatesEntities().
The most likely candidate for public API here is
PackageGenerator.generateEntities(Config, EntityGenerator.Config,
Collection<Table>, OverwriteConfirmer, IProgressMonitor). Does this
sound reasonable?
Karen