Koszi. Igazabol most, hogy meg ketszer atolvastam amit irtal, plusz atolvastam ugyanazt a forrast amit a legelejen, valahogy osszeallt.<br><br>Mindenesetre ugy nez ki, a NetBeans-t is sikerult ravenni arra, hogy legyen kedves felparsolni ezeket a generalt forrasokat, hat meglatjuk, hogy tudok tovabb lepni.<br>
<br>Nagyon koszonom. Neha csak az kell, hogy megkapjam mas megfogalmazasban azt, amit mar egyszer olvastam... :-)<br><br clear="all">Garami Gábor<br>E-mail: <a href="mailto:gabor.garami@hron.me" target="_blank">gabor.garami@hron.me</a><br>
Tel: +36 20 235 9621<br>MSN: <a href="mailto:hrgy@vipmail.hu" target="_blank">hrgy@vipmail.hu</a><br>Skype: hron84<br><br>
<br><br><div class="gmail_quote">2012/3/15 Viczián István <span dir="ltr"><<a href="mailto:viczian.istvan@gmail.com">viczian.istvan@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Szia!<br>
<br>
"Apress - Pro JPA 2 Mastering the Java Persistence API (November 2009).pdf"<br>
(Itt van a papíros is előttem, nem warez.)<br>
A könyvet minden JPA fejlesztőnek javaslom.<br>
270. oldal:<br>
<br>
<br>
Generating the Canonical Metamodel<br>
If you choose to use the generated metamodel in your queries, you<br>
should be aware of some of the<br>
details of the development process in case inconsistency or<br>
configuration issues crop up. The canonical<br>
metamodel classes will need to be updated or regenerated when certain<br>
changes to entities have<br>
occurred during development. For example, changing the name of a field<br>
or property, or changing its<br>
shape, would require an updated canonical metamodel class for that entity.<br>
The generation tools offered by providers may vary widely in function<br>
or in operation. Generation<br>
may involve reading the persistence.xml file, as well as accessing<br>
annotations on entities and XML<br>
mapping files to determine what the metamodel classes should look<br>
like. Since the specification does<br>
not require such tools to even exist, a provider may choose to not<br>
support it at all, expecting that if<br>
developers want to use the canonical metamodel classes they will<br>
handcode them. Most providers do<br>
offer some kind of generation tool, though; it's just a matter of<br>
understanding how that vendor-specific<br>
tool works. It might run statically as a separate command line tool,<br>
or it might use the compiler hook<br>
offered in Java SE 6 to look at the entities and generate the classes<br>
at compile-time. For example, to run<br>
the command line mode of the tool shipped with the EclipseLink<br>
Reference Implementation, you could<br>
set the javac "-processor" and "-proc:only" options. These two options<br>
indicate the EclipseLink<br>
code/annotation processor1<br>
for the compiler to invoke, and instruct the compiler to call only the<br>
processor but not do any actual compilation.<br>
javac -processor<br>
org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor<br>
-proc:only<br>
-classpath lib/*.jar;punit<br>
*.java<br>
The options are on separate lines to make them easier to see. It is<br>
assumed that the lib directory<br>
contains the necessary EclipseLink JAR and JPA 2.0 interface JAR, and<br>
that the META-INF/persistence.xml<br>
is in the punit directory.<br>
Metamodel generation tools will also typically run in an IDE, and<br>
there will likely be IDE-specific<br>
configuration necessary to direct the incremental compiler to use the<br>
tool's annotation processor. In<br>
some IDEs, there must be an additional code/annotation processor JAR<br>
to configure. The generated<br>
metamodel classes will need to go in a specific directory and be on<br>
the build classpath so the criteria<br>
queries that reference them can compile. Consult the IDE help files on<br>
how annotation processors or<br>
APT is supported, as well as the provider documentation on what to<br>
configure in order to enable<br>
generation in a given IDE.<br>
<br>
--<br>
Viczián István<br>
<br>
<br>
<br>
2012/3/15 Gábor Garami <<a href="mailto:gabor.garami@hron.me">gabor.garami@hron.me</a>>:<br>
<div><div class="h5">> Sziasztok,<br>
><br>
> Valószínüleg megint valami alap dolgot nem értek.<br>
><br>
> Olvasgatom a hivatalos JavaEE tutorialnak a Criteria API-ra vonatkozó<br>
> részét, ezt ni: <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gkjiv.html" target="_blank">http://docs.oracle.com/javaee/6/tutorial/doc/gkjiv.html</a><br>
><br>
> Azt látom, hogy a tutorial kézzel generálta meg a Metamodel osztályt. Erre<br>
> van valami mód, hogy automatikusan generáljam? Olvasgattam, hogy a<br>
> Hibernate-hoz van ilyen cucc, meg kulon eclipselink-hez is, ez akkor azt<br>
> jelenti, hogy minden ilyen JPA implementaciohoz a megfelelot kell hasznalni?<br>
> Vagy van valami generikus is, csak nem talalom? Miben kulonboznek ezek<br>
> egyaltalan egymastol? Mert ahogy elnezem, ez valami statikus kod,<br>
> gyakorlatilag ha nagyon megeroltetem magamat, ossze tudok dobni egy<br>
> scriptet, ami a megadott osztaly kodjabol nemi regexes varazslat<br>
> segitsegevel legeneralja azt az osztalyt. Vagy van valami mas titkos dolog<br>
> is, amit en nem latok?<br>
><br>
> Elore is koszonom a segitseget.<br>
><br>
> Udv,<br>
><br>
> Garami Gábor<br>
> E-mail: <a href="mailto:gabor.garami@hron.me">gabor.garami@hron.me</a><br>
> Tel: <a href="tel:%2B36%2020%20235%209621" value="+36202359621">+36 20 235 9621</a><br>
> MSN: <a href="mailto:hrgy@vipmail.hu">hrgy@vipmail.hu</a><br>
> Skype: hron84<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Javalist mailing list<br>
> <a href="mailto:Javalist@lists.javaforum.hu">Javalist@lists.javaforum.hu</a><br>
> <a href="http://lists.javaforum.hu/mailman/listinfo/javalist" target="_blank">http://lists.javaforum.hu/mailman/listinfo/javalist</a><br>
><br>
_______________________________________________<br>
Javalist mailing list<br>
<a href="mailto:Javalist@lists.javaforum.hu">Javalist@lists.javaforum.hu</a><br>
<a href="http://lists.javaforum.hu/mailman/listinfo/javalist" target="_blank">http://lists.javaforum.hu/mailman/listinfo/javalist</a><br>
</blockquote></div><br>