Is Oracle NOW fully supported by .NET entity framework?

What is @javax.persistence.Entity annotation?

  • I'm playing around with the Play! framework. I'm a beginner programmer and this is my first exposure to JPA. I'm getting an error because the "The JPA context is not initialized. JPA Entity Manager automatically start when one or more classes annotated with the @javax.persistence.Entity annotation are found in the application." I have @Entity listed before my class constructor and I thought that was enough. Thanks.

  • Answer:

    The @Entity annotation is used to indicate that a class is persistent. In the Play! Framework you also have to extend from Model or GenericModel. The only difference between the two is that Model auto-generates a Long id to use as a primary key. Here's a basic example : import javax.persistence.*; import play.db.jpa.*; @Entity public class SomeModel extends Model { public SomeModel() { } } You said you put @Entity before the constructor, so I guess that's the cause of your error. Also make sure you extend Model or GenericModel.

Maarten Claes at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.