[Javalist] Criteria API - valahogy nem értem...

Gábor Garami gabor.garami at hron.me
2012. Már. 15., Cs, 19:39:25 CET


Azert valami meg nem kerek.

Osszeraktam egy ilyen pom.xml darabkat:
https://gist.github.com/9d818f5d0584abfd26f0 a neten fellelt infok alapjan.
Viszont forditaskor kapok ilyen warningokat, hogyaszondja:

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @
bookshelf-ejb ---
[INFO] Compiling 7 source files to
/home/hron/Projects/bookshelf/bookshelf-ejb/target/classes
[WARNING]
/home/hron/Projects/bookshelf/bookshelf-ejb/src/main/java/me/hron/bookshelf/ejb/BookFacade.java:[17,33]
cannot find symbol
symbol  : class Book_
location: package me.hron.bookshelf.entities

Ez normalis? Vagy a masodik konfigba valahogy fel kellene vennem a
forraspathek koze a generalt forrasok mappajat? Valami olyasmit olvastam
valahol, hogy ez nem feltetlen szukseges, ez esetben viszont nem ertem a
warningot.

Garami Gábor
E-mail: gabor.garami at hron.me
Tel: +36 20 235 9621
MSN: hrgy at vipmail.hu
Skype: hron84



2012/3/15 Gábor Garami <gabor.garami at hron.me>

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


További információk a(z) Javalist levelezőlistáról