<div dir="ltr">Hey George,<div><br></div><div>I proceeded as we discussed on the meeting on Tuesday. However, I had to copy some of the code of the AbstractJPAFacetImpl in the SpringBootJPAFacet: the contents of the methods getEntityPackage, getEntityPackageDir and getAllEntities.</div><div><br></div><div>Can we somehow move these (and probably other) methods to the API project, so that they can be reused?</div><div><br></div><div>Thanks,</div><div>Ivan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 30, 2015 at 10:22 AM, Ivan St. Ivanov <span dir="ltr">&lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi George,<div><br></div><div>Then maybe we should re-evaluate the initial proposal:</div><span class=""><div><br></div><div><span style="font-size:12.8000001907349px">What we want to do is not to rewrite all the Forge commands for JPA just because of the fact above. We were thinking of a small change - </span><span style="font-size:12.8000001907349px">extend JPAFacet with SpringBootJPAFacet. And then add a new implementation of PersistenceContainer -&gt; SpringBootContainer or something? And then we have to change JPASetupWizardImpl to pick the facet not only based on the JPA version, but also based on the container. </span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div></span><div><span style="font-size:12.8000001907349px">Thanks,</span></div><div><span style="font-size:12.8000001907349px">Ivan</span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 29, 2015 at 11:31 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>How about a SpringBootFacet with a ge/setProperties() method to handle these central properties? <div><br></div><div>As for the JPAFacet, it is necessary to have it installed for the JPA: New Entity to function properly, for example, so I guess you might need to extend it and override the method that creates the persistence.xml file. </div><div><br></div><div><br></div><div>-------- Mensagem original --------</div><div>De: Nayden Gochev &lt;<a href="mailto:gochev@gmail.com" target="_blank">gochev@gmail.com</a>&gt; </div><div>Data: 29/07/2015  17:21  (GMT-03:00) </div><div>Para: &quot;Ivan St. Ivanov&quot; &lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt; </div><div>Cc: forge-dev List &lt;<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a>&gt; </div><div>Assunto: Re: [forge-dev] Approach to Spring Boot handling JPA </div><div><br></div></div><div><div><br><div><div dir="ltr">Yes it is a hack (to keep the persistance.xml and is not good :( <div><br></div><div>So we indeed have to create some <span style="font-size:12.8000001907349px">SpringBootJPAFacet</span><span style="font-size:12.8000001907349px">  to</span> bypass the generation of persistance.xml and to just add few extra properties to the application.properties file ( basically 5-6 lines ).</div><div><br></div><div>The idea with spring boot is 0 configuration and everything is automatically configured ( the only configuration you do is in one central properties file)</div><div><br></div><div>Nayden</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 29, 2015 at 8:22 PM, Ivan St. Ivanov <span dir="ltr">&lt;<a href="mailto:ivan.st.ivanov@gmail.com" target="_blank">ivan.st.ivanov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi George,<div><br></div><div>Thanks for your answer! I add our Spring Boot expert Nayden to the loop.</div><div><br></div><div>Well, according to the Spring documentation it is possible to have persistence.xml: <a href="http://docs.spring.io/spring-boot/docs/current/reference/html/howto-data-access.html#howto-use-traditional-persistence-xml" target="_blank">http://docs.spring.io/spring-boot/docs/current/reference/html/howto-data-access.html#howto-use-traditional-persistence-xml</a></div><div><br></div><div>However, I see it more as a hack from our side.</div><div><br></div><div>Cheers,</div><div>Ivan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 27, 2015 at 10:27 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi Ivan,<br>
    <br>
    JPAFacet depends on having a PersistenceCommonDescriptor
    (<a href="https://github.com/forge/core/blob/master/javaee/api/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFacet.java#L27" target="_blank">https://github.com/forge/core/blob/master/javaee/api/src/main/java/org/jboss/forge/addon/javaee/jpa/JPAFacet.java#L27</a>),
    so I guess that extending JPAFacet is not a good idea in this case.
    Is it a problem if the persistence.xml is created for a Spring Boot
    project?<br>
    <br>
    Otherwise, I&#39;d suggest you to create the SpringBootJPAFacet without
    reusing the JavaEE ones (and create a &quot;Spring Boot: JPA Setup&quot;), as
    they really don&#39;t follow JavaEE in this context beyond the JPA JARs.<br>
    <br>
    Best Regards,<br>
    <br>
    George Gastaldi<div><div><br>
    <br>
    <div>On 07/26/2015 05:52 PM, Ivan St. Ivanov
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div>
      <div dir="ltr">Hi folks,
        <div><br>
        </div>
        <div>As some of you probably heard, in Bulgarian JUG we are
          going to adopt an addon (as George put it a couple of months
          ago). Beginning of August we are going to develop a Forge
          extension for Spring Boot. One of the things that we are not
          sure yet how to tackle is persistence.</div>
        <div><br>
        </div>
        <div>You see, Spring supports JPA. However instead of
          configuring it in the Java EE way with persistence.xml, in
          Spring Boot they use a properties file for that (and for all
          their configuration). The current JPA facet implementations
          however are developed with presistence.xml in mind. The JPA
          setup wizard itself is also bound somehow to presistence.xml -
          it picks the facet to install based on that file.</div>
        <div><br>
        </div>
        <div>What we want to do is not to rewrite all the Forge commands
          for JPA just because of the fact above. We were thinking of a
          small change - <span style="font-size:12.8000001907349px">extend
            JPAFacet with SpringBootJPAFacet. And then add a new
            implementation of PersistenceContainer -&gt;
            SpringBootContainer or something? And then we have to change
            JPASetupWizardImpl to pick the facet not only based on the
            JPA version, but also based on the container. </span></div>
        <div><span style="font-size:12.8000001907349px"><br>
          </span></div>
        <div><span style="font-size:12.8000001907349px">Or maybe there
            is a better way?</span></div>
        <div><br>
        </div>
        <div>I am expecting your feedback :)</div>
        <div><br>
        </div>
        <div>Cheers,</div>
        <div>Ivan </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
forge-dev mailing list
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a></pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>