Announcement Announcement Module
Collapse
No announcement yet.
Problem with creating an entity Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment

      Working...
      X