Results 1 to 3 of 3

Thread: Problem with creating an entity

  1. #1
    Join Date
    Oct 2009
    Posts
    6

    Default Problem with creating an entity

    Hi, I'm new to Roo and I have a lot of questions.
    I have a simple entity

    Code:
    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

    Code:
    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.

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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

  3. #3
    Join Date
    Oct 2009
    Posts
    6

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •