http://www.j2ee.me/javaee/5/docs/api/javax/persistence/EntityManagerFactory.
html
http://www.javaworld.com/javaworld/jw-01-2008/jw-01-jpa1.html 
This annotation is used for the persistence purposes, meaning after
retrieving the data from the Database System we store it in Java objects, so
we use Java objects in our application instead of interrogating the
Database(which is slower).
Happy Coding!

-----Original Message-----
From: java-ee-j2ee-programming-with-passion@googlegroups.com
[mailto:java-ee-j2ee-programming-with-pass...@googlegroups.com] On Behalf Of
stefan.brunig
Sent: September-30-09 2:14 AM
To: peeterbru...@hotmail.com
Cc: j2ee passion
Subject: [java ee programming] Re: Unknow Java statement


hi peeter,

in this context the '@' sign is a so-called annotation. it was
introduced as 'metadata' facility in release 5.0 of the java platform.
please check:

http://java.sun.com/docs/books/tutorial/java/javaOO/annotations.html

or

http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html


as annotations are really useful and widely used, it is quite
important to understand the basics. i suggest to play around with
simple examples so you can see how annotations affect the behavior of
your classes.


--
stefan


On Wed, Sep 30, 2009 at 8:48 AM, peeter brunch <peeterbru...@hotmail.com>
wrote:
> Hi,
>
> Can someone explain the meaning of the highlighted Java statement in the
> following code especially the meaning of the @ sign in front of the
> PersistenceUnit? Thanks.
>
> import database.BookDBAO;
> import javax.servlet.*;
> import util.Counter;
>
> import javax.ejb.*;
> import javax.persistence.*;
>
> public final class ContextListener
>     implements ServletContextListener {
>     private ServletContext context = null;
>
>     @PersistenceUnit
>     EntityManagerFactory emf;
>
> Regards,
> Peeterbrunch
>
>
>
>
> ________________________________
> Bing™ brings you maps, menus, and reviews organized in one place. Try it
> now.
> >
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to