<!-- <questionid="arch-overall"when="init"> Describetheoverallarchitecture. <hint> WhatwillbeAPIfor <ahref="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi"> clientsandwhatsupportAPI</a>? Whatpartswillbepluggable? Howwillplug-insberegistered?Pleaseuse<code><apitype="export"/></code> todescribeyourgeneralAPIs. Ifpossiblepleaseprovide simplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<p>
This module provides the <api group="java" name="JavaPersistenceAPISupportAPI"type="export" category="friend"url="@TOP@index.html"/>
which allows the infrastructure supporting Java Persistence API (JPA) to
retrieve informatiou about JPA features provided by projects. It mainly
consists of SPI interfaces which must be implemented by projects and put in
their default lookups.
</p>
</answer>
<!-- <questionid="arch-quality"when="init"> Howwillthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodebetestedand howarefutureregressionsgoingtobeprevented? <hint> Whatkindoftestingdo youwanttouse?Howmuchfunctionality,inwhichareas, shouldbecoveredbythetests? </hint> </question>
-->
<answer id="arch-quality">
<p>
All Javadoc-specified functionality should be covered by unit tests.
</p>
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonebywhichtheworkshouldbe ready? </hint> </question>
-->
<answer id="arch-time">
<p>
The implementation is done. The target milestone is promo-G.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> <hint> Contentofthisanswerwillbedisplayedaspartofpageat http://www.netbeans.org/download/dev/javadoc/usecases.html Youcanusetags<usecasename="name>regularhtmldescription</usecase> andifyouwanttouseanURLyoucanprefixifwith@TOP@tobegin attherootofyourjavadoc </hint> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitunder whatcircumstances?Whatkindofcodewouldtypicallyneedtobewritten tousethemodule? </question>
-->
<answer id="arch-usecases">
<p>
The entry point to the Java Persistence API is the
<code>persistence.xml</code> file, which contains persistence units.
Persistence units are logical groupings of entity classes and mapping metadata which specifies the mapping of the entity classes to a database.
</p>
<usecase id="retrieve-persistence-location" name="Retrieving the default persistence.xml location">
<p>
The support for Java Persistence API needs to locate the default location
for the <code>persistence.xml</code> file in a project and to
trigger the creation of this location if it doesn't exist. This is
supported by the <code>PersistenceLocation</code> class. It delegates
to the <code>PersistenceLocationProvider</code> interface, which is
supposed to be implemented by projects and put in their lookups.
</p>
</usecase>
<usecase id="retrieve-persistence-scope" name="Retrieving the persistence scope for a file">
<p>
The entity classes defined by a <code>persistence.xml</code> file can be
used by clients, e.g. a servlet or an EJB session bean. It must be possible
for such as client to find out if there is a <code>persistence.xml</code>
available and the entity classes defined by its persistence units.
</p>
<p>
For this the concept of a <em>persistence scope</em> was introduced. A
persistence scope is the grouping of a <code>persistence.xml</code> file
and a classpath containing entity classes. A persistence scope is described
by the <code>PersistenceScope</code> class. The
<code>PersistenceScope.getPersistenceScope(FileObject)</code> method can be
used to retrieve the persistence scope for a given <code>FileObject</code>.
This method delegates to the <code>PersistenceScopeProvider</code>, which
must be implemented by projects and put in their lookups.
</p>
<p>
A <code>PersistenceScope</code> instance is created by implementing the
<code>PersistenceScopeImplementation</code> interface and passing it to the
<code>PersistenceScopeFactory.createPersistenceScope()</code> method.
</p>
</usecase>
<usecase id="retrieve-persistence-scopes" name="Retrieving all persistence scopes in a project">
<p>
Sometimes it is necessary to retrieve a list of all persistence scopes
defined by a project and it must be possible to listen for changes to this
list. This is supported by the <code>PersistenceScopes</code> class. The
<code>PersistenceScopes.getPersistenceScopes(Project)</code> method can be
used to retrieve a <code>PersistenceScopes</code> for a given project. This
method delegates to the <code>PersistenceScopesProvider</code>, which mus
be implemented by projects and put in their lookups.
</p>
<p>
The <code>PersistenceScopes.getPersistenceScopes()</code> method can be
used to retrieve an array of <code>PersistenceScope</code>'s. There are
also methods for adding and removing a <code>PropertyChangeListener</code>
for listening on the list of persistence scopes.
</p>
<p>
A <code>PersistenceScopes</code> instance is created by implementing the
<code>PersistenceScopesImplementation</code> interface and passing it to the
<code>PersistenceScopesFactory.createPersistenceScopes()</code> method.
</p>
</usecase>
<usecase id="implement-persistence-scopes" name="Retrieving all persistence scopes in a project">
<p>
To help a project implement <code>PersistenceScopesProvider</code> easily
the <code>PersistenceScopesHelper</code> class is provided. It supports
managing a <code>PersistenceScope</code> and listening to the respective
<code>persistence.xml</code> file and sending property change events
accordingly.
</p>
</usecase>
<usecase id="implement-persistence-scopes" name="Retrieving all entity classes in a project">
<p>
The support for Java Persistence API needs to retrieve the entity classes
defined in a project. A project can serve as a class library containing entity classes for other projects which does not contain a
<code>persistence.xml</code> itself, thus it doesn't provide any
<code>PersistenceScope</code>'s. This is solved by the
<code>PersistenceClassPathProvider</code> inteface, which returns a
classpath containing entity classes.
</p>
</usecase>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
This module provides APIs needed by the infrastructure supporting Java Persistence API
to locate the persistence features provided by projects.
</p>
</answer>
<!-- <questionid="compat-i18n"when="impl"> Isyourmodulecorrectlyinternationalized? <hint> Correctinternationalizationmeansthatitobeysinstructions at<ahref="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html"> NetBeansI18Npages</a>. </hint> </question>
-->
<answer id="compat-i18n">
<p>
The module does not contain any UI, so it does not need to be internationalized.
</p>
</answer>
<!-- <questionid="compat-standards"when="init"> Doesthemoduleimplementordefineanystandards?Isthe implementationexactordoesitdeviatesomehow? </question>
-->
<answer id="compat-standards">
<p>
The module does not define nor implement any standards.
</p>
</answer>
<!-- <questionid="compat-version"when="impl"> Canyourmodulecoexistwithearlierandfuture versionsofitself?Canyoucorrectlyreadalloldsettings?Willfuture versionsbeabletoreadyourcurrentsettings?Canyouread orpolitelyignoresettingsstoredbyafutureversion? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
<p>
The module does not save nor read any settings.
</p>
</answer>
<!-- <questionid="dep-non-nb"when="init"> WhatotherprojectsoutsideNetBeansdoesthisonedependon? <hint> Somenon-NetBeansprojectsarepackagedasNetBeansmodules (see<ahref="http://libs.netbeans.org/">libraries</a>)and itispreferredtousethisapproachwhenmoremodulesmay dependonsuchthird-partylibrary. </hint> </question>
-->
<answer id="dep-non-nb">
<p>
The module does not depend on any projects outside NetBeans.
</p>
</answer>
<!-- <questionid="dep-platform"when="init"> Onwhichplatformsdoesyourmodulerun?Doesitruninthesame wayoneach? <hint> IfyourmoduleisusingJNIordealswithspecialdifferencesof OSeslikefilesystems,etc.pleasedescribeherewhattheyare. </hint> </question>
-->
<answer id="dep-platform">
<p>
The module should run in the samy way on all platforms.
</p>
</answer>
<!-- <questionid="deploy-dependencies"when="final"> Whatdoothermodulesneedtodotodeclareadependencyonthisone? <hint> Provideasampleoftheactuallinesyouwouldaddtoamodulemanifest todeclareadependency,forexampleusingOpenIDE-Module-Module-Dependencies orOpenIDE-Module-Requires.Youmayusethemagictoken@SPECIFICATION-VERSION@ torepresentthecurrentspecificationversionofthemodule. </hint> </question>
-->
<answer id="deploy-dependencies">
<p>
Only friend modules can declare a dependency on this module.
</p>
</answer>
<!-- <questionid="deploy-jar"when="impl"> DoyoudeployjustmoduleJARfile(s)orotherfilesaswell? <hint> UsuallyamoduleconsistofoneJARfile(perhapswithClass-Path extensions)andalsoaconfigurationfilethatenablesit.Ifyou haveanyotherfiles,use <apigroup="java.io.File"name="yourname"type="export"category="friend"&an>gt;...</api> todefinethelocation,nameandstabilityofyourfiles(ofcourse changing"yourname"and"friend"tosuityourneeds). IfitusesmorethanoneJAR,describewheretheyarelocated,how theyrefertoeachother. IfitconsistofmoduleJAR(s)andotherfiles,pleasedescribe whatistheirpurpose,whyotherfilesarenecessary.Please makesurethatinstallation/uninstallationleavesthesystem instateasitwasbeforeinstallation. </hint> </question>
-->
<answer id="deploy-jar">
<p>
Just the module JAR needs to be deployed.
</p>
</answer>
<!-- <questionid="deploy-packages"when="init"> Arepackagesofyourmodulemadeinaccessiblebynotdeclaringthem public? <hint> NetBeansmodulesystemallowsrestrictionofaccessrightsto publicclassesofyourmodulefromothermodules.Thisprevents unwanteddependenciesofothersonyourcodeandshouldbeused wheneverpossible(<ahref="http://www.netbeans.org/download/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.4-public-packages"> publicpackages </a>).Ifyoudonotrestrictaccesstoyourclassesyouare makingittooeasyforotherpeopletomisuseyourimplementation details,thatiswhyyoushouldhavegoodreasonfornot restrictingpackageaccess. </hint> </question>
-->
<answer id="deploy-packages">
<p>
Only API packages are exported, and only to the friend modules.
</p>
</answer>
<!-- <questionid="format-types"when="impl"> Whichprotocolsandfileformats(ifany)doesyourmodulereadorwriteondisk, ortransmitorreceiveoverthenetwork?Doyougenerateanantbuildscript? Canitbeeditedandmodified? <hint> <p> Filescanbereadandwrittenbyotherprograms,modulesandusers.Iftheyinfluence yourbehaviour,makesureyoueitherdocumenttheformatorclaimthatitisaprivate api(usingthe<api>tag). </p> <p> Ifyougenerateanantbuildfile,thisisverylikelygoingtobeseenbyendusersand theywillbeattemptedtoeditit.Youshouldbereadyforthatandprovideherealink todocumentationthatyouhaveforsuchpurposesandalsodescribehowyouaregoingto understandsuchfilesduringnextrelease,whenyou(verylikely)slightlychangethe format. </p> </hint> </question>
-->
<answer id="format-types">
<p>
The module does not read or write any files.
</p>
</answer>
<!-- <questionid="lookup-lookup"when="init"> Doesyourmoduleuse<code>org.openide.util.Lookup</code> oranysimilartechnologytofindanycomponentstocommunicatewith?Whichones? <hint> Pleasedescribetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclassifythestabilityofsuch APIcontract.Forthatuse<apigroup=&lookup&/>tag. </hint> </question>
-->
<answer id="lookup-lookup">
<api group="lookup" name="org.netbeans.modules.j2ee.persistence.spi.PersistenceScopeProvider" type="export" category="friend">
<p>
Implementations of <code>PersistenceScopeProvider</code> are searched for in the
default lookup and delegated to until one is found which returns a non-null value.
</p>
</api>
</answer>
<!-- <questionid="lookup-register"when="final"> Doyouregisteranythingintolookupforothercodetofind? <hint> Doyouregisterusinglayerfileorusing<code>META-INF/services</code>? Whoissupposedtofindyourcomponent? </hint> </question>
-->
<answer id="lookup-register">
<api group="lookup" name="org.netbeans.modules.j2ee.persistence.spi.PersistenceScopeProvider" type="import" category="friend">
<p>
An implementation of the <code>PersistenceScopeProvider</code> interface
delegating to the project which owns the <code>FileObject</code> passed to
the <code>findPersistenceScope()</code> method is registered in the default
lookup using META-INF/services.
</p>
</api>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
The implementation doesn't consume any memory apart from some
static fields, e.g. the <code>Lookup.Result</code> containing
the registered <code>PersistenceScopeProvider</code>'s.
</p>
</answer>
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet am 2026-09-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.