<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>After pulling in Richard's latest changes everything seems to work as I expect it.</div><div><br></div><div>If you want to try take care of following gotchas:</div><div><br></div><div>1) start the sakila database</div><div><br></div><div>2) make sure your as7 instance has a h2 datasource deployed that corresponds to the sakila database:</div><div><br></div><div> -> put the driver jar (h2-1.3.161.jar) in the as7 deployment folder</div><div><br></div><div> ->create a file 'sakila-ds.xml' with below contents and put it in the as7 deployment folder:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <?<span style="text-decoration: underline">xml</span> version="1.0" encoding="UTF-8"?></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <datasources <span style="text-decoration: underline">xmlns</span>="<a href="http://www.jboss.org/ironjacamar/schema">http://www.jboss.org/ironjacamar/schema</a>"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <datasource <span style="text-decoration: underline">jndi</span>-name="java:jboss/<span style="text-decoration: underline">datasources</span>/<span style="text-decoration: underline">sakila</span>" enabled="true" </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> use-java-context="true" pool-name="HSQLDB"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <connection-<span style="text-decoration: underline">url</span>>jdbc:h2:<span style="text-decoration: underline">tcp</span>://<span style="text-decoration: underline">localhost</span>/<span style="text-decoration: underline">sakila</span></connection-<span style="text-decoration: underline">url</span>></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <driver>h2-1.3.161.jar</driver></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <pool></pool></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <security></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <user-name><span style="text-decoration: underline">sa</span></user-name></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <password></password></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> </security></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> </datasource></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> </datasources></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> </div></div><div>3) use the latest hibernate tools plugin available</div><div><br></div><div> ->forge git-plugin <a href="https://github.com/forge/plugin-hibernate-tools.git">https://github.com/forge/plugin-hibernate-tools.git</a></div><div><br></div><div>4) use the correct settings when reverse engineering:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->table: *</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->schema: *</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->catalog: *</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->entity package: my.test.sakila.model</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->driver: org.h2.Driver</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->path to driver: /Users/koen/Temp/sakila-h2/h2-1.3.161.jar</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->url: jdbc:h2:<a href="tcp://localhost/sakila">tcp://localhost/sakila</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->user: sa</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->password: </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->dialect: org.hibernate.dialect.H2Dialect</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->detect many to many: true</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->detect one to one: true</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "> ->detect optimistic lock: true</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; "><br></div><div>5) after reverse engineering the db and scaffolding the ui and before deploying don't forget to edit the persistence.xml file:</div><div><br></div><div> -> delete or comment the line <span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #000000"> </span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #009192"><</span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #489191">property</span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #000000"> </span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #98228d">name</span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #000000">=</span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; ">"hibernate.hbm2ddl.auto"</span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #000000"> </span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #98228d">value</span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #000000">=</span></span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; ">"create-drop"</span><span class="Apple-style-span" style="color: rgb(65, 58, 246); font-family: Monaco; font-size: 11px; "><span style="color: #009192">/></span></span></div><div><div> -> change the jta-data-source <span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "> </span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #009192"><</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #489191">jta-data-source</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #009192">></span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; ">java:jboss/</span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="text-decoration: underline">datasources</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; ">/</span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="text-decoration: underline">sakila</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #009192"></</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #489191">jta-data-source</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #009192">></span></span></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #009192"><br></span></span></div><div>After doing this, the app should work with the contents of the sakila database.</div><div><br></div><div>Cheers,</div><div>Koen</div><div><br></div><div>Op 21-mrt.-2012, om 00:17 heeft Thomas Frühbeck het volgende geschreven:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
<div text="#000000" bgcolor="#FFFFFF">
I tried hard to get the DB working, but I failed :-/<br>
I am positively convinced that the faces scaffold is well prepared
to handle primitive types, only long seems to be unhandled.<br>
<br>
If I could get the generated code I would try to fix any problem,
but my attempts at reverse engineering failed :-(<br>
<br>
Thomas<br>
<br>
<br>
Am 20.03.2012 20:19, schrieb Lincoln Baxter, III:
<blockquote cite="mid:CAEp_U4HR2hiOXeHP2BNQbXFTGqt+wbJMp7svrx8r_hTtPvWYSw@mail.gmail.com" type="cite">Hmm, ok.<br>
<br>
I tried to get to the root cause of this issue, but since I am not
familiar with Metawidget, I hit a road block around line 265 of
FacesScaffold.java ( JavaClass viewBean =
JavaParser.parse(JavaClass.class,
this.backingBeanTemplate.render(context)); ) The template simply
takes Metawidget's contents and inserts it, I'm not sure how to
continue.<br>
<br>
Thomas or Richard, any chance you could take a look at this
project (the result of running the new scaffold on a reverse
engineered database.) and see what we can do to resolve this
compliation issue?<br>
<br>
It's specifically caused because the generated entities are using
primitive types (short, long) instead of object types for their ID
fields, so I guess we need to support both.<br>
<br>
Thoughts? How easy is this to fix?<br>
<br>
~Lincoln<br>
<br>
<div class="gmail_quote">On Tue, Mar 20, 2012 at 2:49 PM, Koen
Aers <span dir="ltr"><<a moz-do-not-send="true" href="mailto:koen.aers@gmail.com">koen.aers@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">In
attachment the project that was generated from the sakila
database (<a moz-do-not-send="true" href="https://github.com/maxandersen/sakila-h2" target="_blank">https://github.com/maxandersen/sakila-h2</a>)
using the hibernate tools plugin and scaffolding. It contains
a number of problems related to primitive types and their
object counterparts.<br>
<br>
<br>
<br>
_______________________________________________<br>
forge-dev mailing list<br>
<a moz-do-not-send="true" href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a moz-do-not-send="true" href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Lincoln Baxter, III<br>
<a moz-do-not-send="true" href="http://ocpsoft.org/" target="_blank">http://ocpsoft.org</a><br>
"Simpler is better."<br>
</blockquote>
<br>
</div>
</blockquote></div><br></body></html>