1 Reply Latest reply on Dec 29, 2010 3:25 PM by isonisak

    How do can I tell the "generate-ui" command to look at the getters of an entity class?

    erisch

      Hi folks!


      I'm new to Seam and I'm facing a problem with the generate-ui feature of seam-gen.


      I have one JPA entity class (which I have copied from a non-Seam project) which is working correctly in a Swing based application etc. And now I'm trying to generate the ui components for the basic CRUD operations with seam-gen. I don't want to reverse engineer a JPA entity with Seam because my own entity provides a little bit more functionality already.


      To make a long story short, the said entity class uses a DateTime class internally which belongs to the popular Joda-Time library. And seam generate-ui complains with the following message if I try to generate view classes for this entity:



      [hibernate] Problems in creating a configuration for JPA. Have you remembered to add hibernate EntityManager jars to the classpath ?
      [hibernate] java.lang.reflect.InvocationTargetException
      [hibernate] java.lang.NoClassDefFoundError: Lorg/joda/time/DateTime;
      [hibernate] java.lang.ClassNotFoundException: org.joda.time.DateTime
      [hibernate] A class were not found in the classpath of the Ant task.
      [hibernate] Ensure that the classpath contains the classes needed for Hibernate and your code are in the classpath.



      Unfortunately I couldn't find out where I have to put additional JAR files to be found by the seam-gen commands.


      But what makes me even more puzzling is that I only use the DateTime class internally!!! In great foresight I have used the plain old Date type for the setter and getter to avoid trouble with other tools etc. but obviously despite having annotated the accessor method of my JPA class, the reverse engineering process of Hibernate seems to use the private properties instead.


      I'd really be thankful if anyone could explain me either where to put additional library JARs or how to configure seam-gen to look at the accessor methods of an entity for ui generation! Of course I'd be glad to hear an answer for both questions :-)


      Thanks in advance!


      Marco