Announcement Announcement Module
No announcement yet.
Create Entity without Roo anotations Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Create Entity without Roo anotations

    Hi there,

    I start to lean Roo, so sorry if this is stupid question:

    Is it possible to create entities with Roo that have original JPA annotations instead of Roo annotations like @RooJavaBean, @RooToString or @RooEntity.

    I suppose that Roo cannot handle the generated class without Roo annotations in that case, but that doesn't matter. I've seen that files with the extension *.aj have been generated that have only JPA annotations. Are these classes (e.g. "MyClass_Roo_Entity.aj") generated out of the java file with the Roo anotations? Can I use the content of these files for my purpose? Is there an official way to do without Roo anotations?


  • #2
    It is an understandable question...

    My recommendation to you is: Spend few minutes reading the Roo reference manual or get[URL=""[/URL]. In short time everything would make sense to you. It is a worthy investment.



    • #3
      Sounds like you want Roo to setup the project for you and then you want to remove Roo from the project.

      As delgad9 stated, the reference manual that comes with Roo has a whole section on how to remove Roo from the project.


      • #4
        Just create a class (use the Roo "class" command if you want) and then add your @Entity annotation manually.


        • #5
          ... or if you want Roo to generate all the usual code as a starting point, do this:
          1. use the entity command to create the entity
          2. add your entity's business fields (i.e. not id or version) using the field command
          3. use your IDE to push in all the ITDs for the entity
          4. remove the @RooXxx annotations from the entity
          You will now have a JPA entity with CRUD methods, and none of it managed by Roo.