Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, in Java (5 and higher), "things" starting with a <code>@</code> (e.g. <code>@Deprecated</code>) are called <a href="http://download.oracle.com/javase/tutorial/java/javaOO/annotations.html" rel="nofollow">annotations</a>.</p> <blockquote> <p><em>Annotations</em> provide data about a program that is not part of the program itself. They have <strong>no direct effect</strong> on the operation of the code they annotate.</p> </blockquote> <p>Your JavaBeans needs to be configured to a scope if you want to use it in JSF (Definitions can be found <a href="http://www.java-samples.com/showtutorial.php?tutorialid=472" rel="nofollow">here</a>).</p> <ul> <li><code>@RequestScoped</code>: Objects with this scope are visible from the start of the request until the end of the request. Request scope starts at the beginning of a request and ends when the response has been sent to the client. If the request is forwarded, the objects are visible in the forwarded page, because that page is still part of the same request/response cycle. Objects with request scope can use other objects with none, request, session, or application scope. If you have to think it in terms of servlet, the managed bean is stored in the <code>HttpServletRequest</code> until the end of the request (when the response is sent to the client). After that, the bean no longer exists in the request.</li> <li><code>@SessionScoped</code>: An object with session scope is visible for any request/response cycle that belongs to a session. Objects with this scope have their state persisted between requests and last until the object or the session is invalidated. Objects with session scope can use other objects with none, session, or application scope. Basically, these objects are stored in a <code>HttpSession</code> (refer to Servlets again). Each session has a session ID (known as <code>JSESSIONID</code>) that the bean is associated with.</li> <li><code>ApplicationScoped</code>: An object with application scope is visible in all request/response cycles for all clients using the application, for as long as the application is active. In terms of Servlet, this could be, managed bean stored in a <code>ServletConfig</code>.</li> <li><code>@NoneScoped</code>: Objects with this scope are not visible in any JSF page. When used in the configuration file, they indicate managed beans that are used by other managed beans in the application. Objects with none scope can use other objects with none scope.</li> </ul> <hr> <p>For <a href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" rel="nofollow"><code>EntityManager</code></a>, this is associated with persistence context. It is used to create and remove persistent entity instances, to find entities by their primary key identity, and to query over all entities. For more, refer to the JPA (Java Persistence API) Specification, or <a href="http://docs.jboss.org/hibernate/entitymanager/3.5/reference/en/html_single/" rel="nofollow">Hibernate</a>.</p> <p><a href="http://download.oracle.com/javaee/6/api/javax/inject/Inject.html" rel="nofollow"><code>@Inject</code></a>, means that the instance is injectable. They follow the infamous crase word of <em>Depency Injection</em> or <em>Inversion of Control (IOC)</em>. What this basically mean, is that when the resource (in your case <code>EntityManager entityManager</code> is needed, the JEE container instantiates the resource for you (without you needed to instantiate it directly through e.g. a constructor, etc.).</p> <p>I have no clue what <code>@DataRepository</code> means. Never seen it before.</p> <p>I hope this helps you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload