A persistence unit must have a name. Only one persistence unit of any given name must be defined
within a single EJB-JAR file, within a single WAR file, within a single application client jar, or within an EAR. See Section 8.2.2, “Persistence Unit Scope”.
A persistence unit that is defined at the level of an EJB-JAR, WAR, or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to the components defined in that jar or war.
A persistence unit that is defined at the level of the EAR is generally visible to all components in the application.
Frits Walraven wrote:Hi Ann,
You should be able to create a filter on the default servlet.
Can you post the part of your web.xml where you define the default servlet (<servlet> and <servlet-mapping>)?
Mark Spritzler wrote:
1) What is your target audience? Do they only have iPhones, if so, why waste time writing in other device languages.
2) Are you only doing this because you think it will make your rich? Odds are against it now.
3) Build a website app instead and all the phones can view it.
4) Write the same app in all the different languages.
I will say this, I have 4 iPhone apps, and I have written a few J2ME apps, no Android yet. And I think J2ME is done. Objective-C for iPhones and Andriod in Java are to me the only viable solutions.
Opinion given above.
In a more complex example, imagine that the association between Employee and Organization
is maintained in an Employment table full of historical employment data. An association to the
employee's most recent employer, the one with the most recent startDate, could be mapped in
the following way:
Neha Daga wrote:you did not initialize the variable "value" so it gets default null value. now when you run A class constructor it gives a call to super class constructor which calls method m1 till this time subclass (class A) constructor has not been run. so, value of variable is not initialized to "A" and hence null is printed.
Wouter Oet wrote:That's because final fields are set at compile time and non-final fields at run-time.
This filter acts as an interceptor for servlet requests. It runs every time a request hits the server and must be processed. It needs the SessionFactory on startup, and it gets it from the HibernateUtil helper class. When the request arrives, you start a database transaction and open a new persistence context. After the controller has executed and the view has been rendered, you commit the database transaction. Thanks to Hibernate’s auomatic Session binding and propagation, this is also automatically the scope of the persistence context.