PDA

View Full Version : Problem with creating an entity



kvamer
Oct 23rd, 2009, 05:29 AM
Hi, I'm new to Roo and I have a lot of questions:).
I have a simple entity


import javax.persistence.Entity;
import org.springframework.roo.addon.javabean.RooJavaBean ;
import org.springframework.roo.addon.tostring.RooToString ;
import org.springframework.roo.addon.entity.RooEntity;
import javax.persistence.Table;

@Entity
@RooJavaBean
@RooToString
@RooEntity(identifierColumn = "MYENTITY_ID")
@Table(name = "MYENTITY")
public class MyEntity {
}

and a method in some other class that uses it, say


public void useEntity() {
System.out.println("Point 1");
MyEntity myEntity = new MyEntity();
System.out.println("Point 2");
}

Then I compile it with maven. Everything is ok, no erorrs. After this I start my application and see only "Point 1". Nothing more. No exceptions, no errors. Could anyone help me? Thanks in advance.

Stefan Schmidt
Oct 23rd, 2009, 09:51 PM
Hi,

I have tried to replicate your scenario and cannot reproduce it. I have created an entity MyEntity (with an integration test) and annotated it the same way you did. I then put your code into the test marker method in the integration test. That works just fine for me.

Can you please elaborate more on what exactly you are trying to do and how? Maybe you can share your complete project (just use the backup command)?

Cheers,
Stefan

kvamer
Oct 26th, 2009, 03:44 AM
Hi, Stefan,
Many thanks for your answer. I did find the reason and it was... very simple. Some libraries in my classpath were missing. I ran it in a separate thread and maybe because of this I didn't notice any NoClassDefFoundError errors.