Announcement Announcement Module
Collapse
No announcement yet.
Using Roo with an existing database Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Status

    Ben,

    Just wondering if you can give us a status update on this feature? Do you have a ETA on when it will be available?

    I am more than willing to help beta test once it is to that stage. I can test against a few Oracle databases as well as a PostGres db.

    Marty

    Comment


    • #32
      It's our #1 voted issue in Jira and will be in Roo 1.1.0. Realistically the first milestone containing this feature is likely in March 2010, although of course no guarantees can be made. In the meantime you can use Eclipse to reverse engineer an existing database and Roo will be fine with that. I'd suggest voting/watching https://jira.springsource.org/browse/ROO-435 so you can receive updates.

      Comment


      • #33
        Ben,

        Thanks for the update. I am currently using HibernateTools to generate the entity objects. What plugin are you referring to in Eclipse that allows you to reverse engineer a existing db?

        Marty

        Comment


        • #34
          Ben,

          nevermind on the last question. I figured out how to do it.

          Marty

          Comment


          • #35
            Originally posted by MartyJones View Post
            Ben,

            nevermind on the last question. I figured out how to do it.

            Marty
            Maybe you could let the rest of us in on the secret?

            Comment


            • #36
              Sure,

              From within Eclipse, open the "Database Development Perspective" (Window-> Open Perspective -> Database Development). Now setup a new DataConnection to your database using the "Datasource Explorer" panel.

              Next create a new JPA project and select the connection that you just created when you get to the "Configure JPA" settings page of the create project wizard. Once the project is created then right click on the project name and select JPA Tools -> "Generate Entites from Tables".

              Here is a link to a blog that I found that helped me. http://blog.platinumsolutions.com/node/221

              Marty
              Last edited by MartyJones; Feb 17th, 2010, 05:26 AM.

              Comment


              • #37
                Roo annotations adding required

                With Database Development Perspective from Eclipse or Hibernate Tools from Eclipse or Ant you generate JPA annotated entities.

                But, Roo requires to work more annotations added by hand like @RooEntity and optionally @RooJavaBean and @RooToString (is getters/setters or toString methods are not generated).

                One additional problem is that property annotations on Roo are spected on properties and this tools generate the annotations on getters. In other words, Roo can't detect database mapping if annotations are on getter methods.

                am I wrong ?

                Comment


                • #38
                  You are correct, Mario. While the reverse engineered entities will work with the JPA provider, Roo's MVC and integration testing services won't discover the annotation metadata on accessors. ROO-435 will offer a more complete solution. In the meantime you can perform a reverse engineer and manually move the annotations to the fields, plus manually add @Roo* annotations to the entities (and delete the generated accessor/mutator methods to clean up the classes).

                  Comment


                  • #39
                    Roo using exsisting DB

                    Hi
                    As i saw to use roo you have to create your own entites. But i have a big application with 24 tables and almost i have 20 columns in each table. it becomes difficult to write each entity and respected fields. Is there any way like JPA provides to genrate entites from the DB.
                    thought i ahve genrated entities from JPA and later use @RooEntity in that and complete the roo applicatiobn. But at run time i am facing this error

                    "Failed to invoke handler method [public java.lang.String com.neev.itrack.web.AgentController.createForm(org .springframework.ui.ModelMap)]; nested exception is java.lang.IllegalStateException: Entity manager has not been injected (is the Spring Aspects JAR configured as an AJC/AJDT aspects library?)"

                    Stack Trace
                    "org.springframework.web.bind.annotation.support.H andlerMethodInvoker.invokeHandlerMethod(HandlerMet hodInvoker.java:171)
                    org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.invokeHandlerMethod(An notationMethodHandlerAdapter.java:414)
                    org.springframework.web.servlet.mvc.annotation.Ann otationMethodHandlerAdapter.handle(AnnotationMetho dHandlerAdapter.java:402)
                    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:771)
                    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:716)
                    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:647)
                    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:552)
                    javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
                    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
                    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
                    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
                    org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:646)
                    org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:436)
                    org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:374)
                    org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:302)
                    org.tuckey.web.filters.urlrewrite.NormalRewrittenU rl.doRewrite(NormalRewrittenUrl.java:195)
                    org.tuckey.web.filters.urlrewrite.RuleChain.handle Rewrite(RuleChain.java:159)
                    org.tuckey.web.filters.urlrewrite.RuleChain.doRule s(RuleChain.java:141)
                    org.tuckey.web.filters.urlrewrite.UrlRewriter.proc essRequest(UrlRewriter.java:90)
                    org.tuckey.web.filters.urlrewrite.UrlRewriteFilter .doFilter(UrlRewriteFilter.java:417)
                    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
                    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
                    org.springframework.web.filter.HiddenHttpMethodFil ter.doFilterInternal(HiddenHttpMethodFilter.java:7 1)
                    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
                    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
                    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
                    org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :88)
                    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
                    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
                    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
                    org.springframework.web.filter.ShallowEtagHeaderFi lter.doFilterInternal(ShallowEtagHeaderFilter.java :57)
                    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
                    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
                    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
                    org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter.doFilterInternal(OpenEntityManager InViewFilter.java:113)
                    org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
                    org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
                    org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
                    org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
                    org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
                    org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
                    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
                    org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
                    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:298)
                    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:852)
                    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:588)
                    org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:489)
                    java.lang.Thread.run(Thread.java:619)"

                    Can you guide me if this issue is because of entites or anything else.

                    Thanks
                    Palam Garg

                    Comment


                    • #40
                      I'm not sure if you need this tutorial: http://forum.springsource.org/showthread.php?t=86474

                      Comment


                      • #41
                        facing problem is the Spring Aspects JAR configured as an AJC/AJDT aspects library

                        Hi thanks for your reply
                        i have seen your Tutorial i really like it but i have done most of the stuff that is already mention there.
                        But i still don't know how i am getting this error. can you help me in solving this error

                        Thanks
                        Palam

                        Comment


                        • #42
                          Roo on existing domain classes

                          It's also possible to create the Java domain classes using Hibernate Tools. A tutorial shows that quite nicely at http://netbeans.org/kb/docs/web/hibernate-webapp.html

                          I wonder if anyone has used Roo from an existing set of Java domain classes.

                          Comment


                          • #43
                            entityManager NULL

                            I am having the same problem as Palmgarg - entityManager NULL (using PetClinic as the reference point for my current code).

                            I have a separate post on this problem and I also posted it in JavaRanch several days ago.

                            Can anyone help?

                            Many Thanks in advance.

                            Comment

                            Working...
                            X