3 Replies Latest reply on Feb 19, 2007 1:27 AM by maxandersen

    Seam-gen Issues

    phicorp

      Hello All,

      I have experienced the following seam-gen issues using PostgreSQL 8.0.3

      When I run seam-gen, I receive an error message which states that the expression property.value.typeName is undefined in the following line
      <#if property.value.typeName == "string">
      within the freemarker template file called list.xhtml.ftl

      When I examined the trace, I found that the above error occurred because the view called pg_logdir_ls does not have a primary key.

      I do not know where this view comes from, as it was not created by me.

      I then deleted the generated entities and the view, and re-ran seam generate-entities again, and this time I did not receive the error message above.

      However, when I attempt to run the generated output, I receive a deployment error stating Missing table: pg_logdir_ls

      Could anyone help me with the following questions:

      (1) What creates the view called pg_logdir_ls?

      (2) Why do I receive the deployment error after:
      (a) Deleting all of the generated entities from the first unsuccessful run of seam generate-entities,
      (b) Deleting the view called pg_logdir_ls, and
      (c) Re-running seam generate-entities?

      (3) Is there a more widespread problem with seam-gen and views which do not have a primary key, or is my problem constrained to my environment?

      Looking forward to any help you can provide.

      Many thanks,
      Bruce.

        • 1. Re: Seam-gen Issues
          gavin.king

          Every table should have a primary key. Otherwise it is not a relation. Neither seam-gen nor Hibernate nor JPA will ever support tables with no primary keys. I have no idea where this table comes from.

          • 2. Re: Seam-gen Issues
            phicorp

            Hello Gavin,

            Its a database view, not a Table, and many applications have database views which do not have primary keys.

            Many thanks,
            Bruce.

            • 3. Re: Seam-gen Issues
              maxandersen

              (1) probably some built in view of your database

              (2) do not know. you would need to show the full error message/stack trace for me to see what is causing it

              (3) views (or tables) without a primarykey is currently handled by letting all columns be the composite-id. That gives problems for seam-gen pre seam 1.1.6, but is fixed in cvs so you should get better mileage there.

              That being said I think we need to start ignoring/skipping table/views without a proper identification.

              see http://opensource.atlassian.com/projects/hibernate/browse/HBX-883