[play-framework] Error when import some models class ::: UnsupportedOperationException occured : Please annotate your JPA model with @javax.persistence.Entity annotation.

178 views
Skip to first unread message

sbeaulois

unread,
May 13, 2010, 1:32:55 PM5/13/10
to play-framework
Hi
Excuse me for my english (I speack french so i do all my best to
translate my problem)
I have create two module using playframework .
In my first module named Admin i have this structure
app/controllers/
Users.java
app/models/
User.java
Profil.java
Right.java

After that i have compil my models package and create a new jar file

# javac -classpath ../../playFramework\ 1.0.1/framework/
play.jar:../../playFramework\ 1.0.1/framework/lib/*: admin/models/
*.java create .class files

And when Copy all generate class to a new diectory admin/models/
*.class
#jar cvfm admin-0-1.jar META-INF/MANIFEST.MF admin/models/*


In my second module i have import admin-0-1.jar in my project without
any probleme.
I can see all class and their methods using my IDE netbeans

app/controllers/
Clients.java
app/models/Client.java

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

sbeaulois

unread,
May 13, 2010, 1:44:03 PM5/13/10
to play-framework
Hi
Excuse me for my english (i speak french so i do all my best to
translate my problem)

I have create two module using playframework .
In my first module i have this structure
app/controllers/
Users.java
app/models/
User.java
Profil.java
Right.java

After that i have compiled my models package and create a new jar file
like this

# javac -classpath ../../playFramework\ 1.0.1/framework/
play.jar:../../playFramework\ 1.0.1/framework/lib/*: admin/models/
*.java

And then Copy all generate .class to a new diectory admin/models/
*.class and create jar

# jar cvfm admin-0-1.jar META-INF/MANIFEST.MF admin/models/*

In my second module i have import admin-0-1.jar in my project without
any probleme.
I can see all class and their methods using my IDE netbeans

app/controllers/
Clients.java
app/models/Client.java

This my Clients.java Contollers Class content
**------------------------------
package controllers;

import admin.models.*;
import models.*;

public class Clients extends Controller {

public static void index() {
User user = User.find("byUuid","087fea9e-da13-4119-
a77e-5a52b8aaf2e1").first();
render(user);
}

}

*-----------------------------------------------------------------------------------------------
*



this is my User.java content

*---------------------
package admin.models;

import java.util.*;
import javax.persistence.*;
import play.data.validation.*;
import play.db.jpa.*;
import play.libs.Codec;

@Entity
@Table(name="user")
public class User extends Model {

@Column(nullable=false)
public String uuid ;

@Required(message="Votre Titre est requis !")
@Column(length=64,nullable=false)
public String titre ;*/

@Required(message="Votre nom est requis !")
@MinSize(3)
@Column(length=64,nullable=false)
public String name ;

@Required(message="Votre prénom est requis !")
@MinSize(4)
@Column(length=128,nullable=false)
public String fullname;

@Email
@Required(message="Votre email est requis !")
@Column(nullable=false, length=64)
public String email;

public User(){
}

@Override
public String toString() {
return this.name;
}

}

*-----------------------------------------------------------*

But when i run my second module i have this error :

Java exception

UnsupportedOperationException occured : Please annotate your JPA model
with @javax.persistence.Entity annotation.


Please Can you help ...

beaulois serge

unread,
May 14, 2010, 9:18:41 AM5/14/10
to play-framework


2010/5/13 sbeaulois <ybs...@gmail.com>



--
The L

Shehan Smp

unread,
Aug 24, 2016, 11:31:00 AM8/24/16
to play-framework, ybs...@gmail.com
I have the same problem. what is the solution?
Reply all
Reply to author
Forward
0 new messages