Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] How to create EclipseLink Sessions, ORM.xml files in J2SE environment

Hi Kris,

Are there specific reasons you have chosen the sessions.xml route (rather than JPA)?

The key thing to remember about sessions.xml is that it is and EclipseLink specific parallel to persistence.xml in JPA. As a result, you need to provide some EclipseLink specific metadata as well. That is specified by providing either an XML file or a class file that defines the metadata as the "primary-project" in your sessions.xml (note, the xml file is different from the JPA orm.xml file). Although it is possible to write those files yourself, it is far easier to use the EclipseLink Mapping Workbench to generate them. It is a GUI tool that allows you to define your mappings and then export the appropriate metadata file. It even allows you to work with sessions.xml.

  There is some documentation about the workbench here:

http://wiki.eclipse.org/Using_Workbench_%28ELUG%29

-Tom

krisusa123 wrote:


Forgot to attach my sessions.xml file in my previous reply.
Hi Tom Thanks for the reply. I started using pure JPA solution and that worked where I registered the entity class using persistence.xml file Then I started looking at getting the same done using EclipseLink API and have developed this sessions.xml file attached below. I did not understand how I can register my TestETL class in the sessions.xml file. I am not using workbench at all. Do I need to configure both my sessions.xml file and and from either your project class or your deployment
xml(generated with the EclipseLink Mapping Workbench)
or is it my sessions.xml file or project class or deployment xml ? Appreciate your help. Thanks
<?xml version = /'1.0'/ encoding = /'UTF-8'/?>

<sessions version=/"1.0"/ xmlns:xsd=/"http://www.w3.org/2001/XMLSchema"/

xmlns:xsi=/"http://www.w3.org/2001/XMLSchema-instance"/

xsi:noNamespaceSchemaLocation=/"http://www.eclipse.org/eclipselink/xsds/eclipselink_sessions_1_0.xsd"/>

<session xsi:type=/"database-session"/>

<name>Prototype</name>

<logging xsi:type=/"eclipselink-log"/>

<log-level>fine</log-level>

</logging>

<login xsi:type=/"database-login"/>

<platform-class>_org_.eclipse.persistence.platform.database.OraclePlatform</platform-class>

<user-name>xx</user-name>

<password>xx</password>

<sequencing>

<default-sequence xsi:type=/"native-sequence"/>

<name>Native</name>

</default-sequence>

</sequencing>

<driver-class>oracle._jdbc_.driver.OracleDriver</driver-class>

<connection-url>jdbc:oracle:thin:@//_xx_/xx</connection-url>

</login>

</session>

</sessions>


--- On *Tue, 1/20/09, Tom Ware /<tom.ware@xxxxxxxxxx>/* wrote:

    From: Tom Ware <tom.ware@xxxxxxxxxx>
    Subject: Re: [eclipselink-users] How to create EclipseLink Sessions,
    ORM.xml files in J2SE environment
    To: "EclipseLink User Discussions" <eclipselink-users@xxxxxxxxxxx>
    Date: Tuesday, January 20, 2009, 8:06 AM

    Hi Kris,

      This error generally occurs because for some reason the metadata for your
    TestEtl class is not available to EclipseLink and you are treating it as
    persistent.

      Depending on how you are configured, the metadata can come from different
    places.

      If you are using a pure JPA solution, it will be derived from Annotations,
    orm.xml and your persistence.xml file.

      If you are using the EclipseLink-proprietary APIs, it will be derived from
    your sessions.xml and from either your project class or your deployment
    xml(generated with the EclipseLink Mapping Workbench)

      Perhaps you can explain a little more about which of these files you are
    using and what you are doing when you see the error.

    -Tom

    krisUSA123 wrote:
    > Based on EclipseTeam's suggestions, I was able to create sessions.xml
    file
> and was trying to create a CRUD operation. > May I know what this error means: > > Exception Description: Missing descriptor for [class com.xx.TestEtl].
    Verify that the descriptor has been properly registered with the Session.
> > How do I fix it? > > Appreciate your help. > Thanks guys for being responsive to my earlier post. > > Thanks
    > Kris
    _______________________________________________
    eclipselink-users mailing list
    eclipselink-users@xxxxxxxxxxx
    https://dev.eclipse.org/mailman/listinfo/eclipselink-users



------------------------------------------------------------------------

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


Back to the top