You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by NoviceUserJPA <K_...@yahoo.com> on 2007/12/04 04:32:58 UTC
Hi , Need A Help
Hi All ,
Thanks for the Forum , I am New to JPA , i have gone through the Basics of
JPA , But Can anyone tell me the Simple steps , for creating a sample
Project in JPA , with Tomcat and MySql. Pls if u have any small Project Do
post it here.
Thanks,
-K.Tr
--
View this message in context: http://www.nabble.com/Hi-%2C-Need-A-Help-tf4940912.html#a14143949
Sent from the OpenJPA Developers mailing list archive at Nabble.com.
Re: Hi , Need A Help
Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
-K.Tr wrote:
> and i also create a web application project with a page , now how i will use
> this coreProject , here to access the entities , Right now i am just
> compilin the Core project and i put those web-inf/classes folder of the
> tomcat and running it , but i can't able to access the database.
What did you try? What errors do you get?
Try first by making simple JSP page, see if it works. Then import your
classes on JSP page, and use them.
Regards,
Ognjen
Re: Hi , Need A Help
Posted by "-K.Tr" <sa...@yahoo.com>.
Hi Mike ,
Thanks For the Concerned Reply ,
Now i Have to develop a simple web application ,
i have my entities in a project with build.xml and persistence.xml in the
meta-inf (name this is as CoreProject.)
and i also create a web application project with a page , now how i will use
this coreProject , here to access the entities , Right now i am just
compilin the Core project and i put those web-inf/classes folder of the
tomcat and running it , but i can't able to access the database.
pls help me out to do it in a proper way.
Thanks ,
-K.Tr
--
View this message in context: http://www.nabble.com/Hi-%2C-Need-A-Help-tf4940912.html#a14164081
Sent from the OpenJPA Developers mailing list archive at Nabble.com.
Re: Hi , Need A Help
Posted by Michael Dick <mi...@apache.org>.
The PCEnhancerTask will run the OpenJPA PCEnhancer tool on your entities.
The Enhancer inserts additional bytecode into your compiled classes which
allows the OpenJPA runtime to track the state of your entities more
efficiently (among other things).
More detail is available in the OpenJPA manual at
http://openjpa.apache.org/docs/latest/manual/ref_guide_pc_enhance.html.
In most cases running the enhancer is an optional step. If you're running in
an Application Server the contain will enhance many of your classes
automatically. There's also automatic subclassing support which works
outside of an Application Server (documented in section 2.4 of the link I
above).
I hope this helps. In general if you don't see any errors when you run the
PCEnhancerTask you're in good shape. If you want to see which classes it's
enhancing you can enable openjpa trace by adding this property to
persistence.xml :
<property name="openjpa.Log" value="DefaultLevel=TRACE"/>
-Mike
On Dec 4, 2007 11:09 AM, -K.Tr <sa...@yahoo.com> wrote:
>
> Thanks Ognjen ,
>
> I have done that , and its working fine , i have done a simple example ..
>
> now i want to use the build.xml , in that i am seeing the
> <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask
> ">
>
> what this exactly do , its building without any errors..but after the
> build
> wat exact;y happens..
>
> can u pls explain this build script
>
> Thanks.
> K.Tr
>
>
>
>
> Ognjen Blagojevic wrote:
> >
> > NoviceUserJPA wrote:
> >> Hi All ,
> >>
> >> Thanks for the Forum , I am New to JPA , i have gone through the Basics
> >> of
> >> JPA , But Can anyone tell me the Simple steps , for creating a sample
> >> Project in JPA , with Tomcat and MySql. Pls if u have any small Project
> >> Do
> >> post it here.
> >
> > 1. Create table in MySQL
> > 2. Create JavaBean representing that table
> > 3. Create persistence.xml file
> > 4. Create test class that uses JavaBean from step 2.
> >
> > It is (almost) the same thing with or w/o Tomcat.
> >
> > Regards,
> > Ognjen
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Hi-%2C-Need-A-Help-tf4940912.html#a14148743
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>
>
Re: Hi , Need A Help
Posted by "-K.Tr" <sa...@yahoo.com>.
Thanks Ognjen ,
I have done that , and its working fine , i have done a simple example ..
now i want to use the build.xml , in that i am seeing the
<taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
what this exactly do , its building without any errors..but after the build
wat exact;y happens..
can u pls explain this build script.
Thanks.
K.Tr
Ognjen Blagojevic wrote:
>
> NoviceUserJPA wrote:
>> Hi All ,
>>
>> Thanks for the Forum , I am New to JPA , i have gone through the Basics
>> of
>> JPA , But Can anyone tell me the Simple steps , for creating a sample
>> Project in JPA , with Tomcat and MySql. Pls if u have any small Project
>> Do
>> post it here.
>
> 1. Create table in MySQL
> 2. Create JavaBean representing that table
> 3. Create persistence.xml file
> 4. Create test class that uses JavaBean from step 2.
>
> It is (almost) the same thing with or w/o Tomcat.
>
> Regards,
> Ognjen
>
>
--
View this message in context: http://www.nabble.com/Hi-%2C-Need-A-Help-tf4940912.html#a14148743
Sent from the OpenJPA Developers mailing list archive at Nabble.com.
Re: Hi , Need A Help
Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
NoviceUserJPA wrote:
> Hi All ,
>
> Thanks for the Forum , I am New to JPA , i have gone through the Basics of
> JPA , But Can anyone tell me the Simple steps , for creating a sample
> Project in JPA , with Tomcat and MySql. Pls if u have any small Project Do
> post it here.
1. Create table in MySQL
2. Create JavaBean representing that table
3. Create persistence.xml file
4. Create test class that uses JavaBean from step 2.
It is (almost) the same thing with or w/o Tomcat.
Regards,
Ognjen