2 Replies Latest reply on Nov 27, 2007 2:40 AM by adriju

    Problems when generating entities

    adriju

      Hi!! I am new in all this world and I have problems with the Seam.
      First, I am using an Oracle 9.2 DB. There are tables that have simple primary-keys and others that have composite primary-keys. Other tables have foreign-keys and a mix of primary and foreign keys.
      I want to generate the entities corresponding to each table of my DB using seam-gen. I create a project in Seam and then I type 'seam generate-entities' from which I receive a successful build. The problem comes when I type 'seam restart', I receive BUILD FAILED.
      When I see inside my project I can see several generated files corresponding to the tables in the DB. For example, I have this table:

      table GRUPOS_USUARIOS
      (
      COD_GRUPOS_USUARIOS NUMBER(10) not null,
      NOMBRE_GRUPOS_USUARIOS VARCHAR2(60) null,
      primary key (COD_GRUPOS_USUARIOS)
      )

      seam-gen generates 3 files GrupoUsuarios.java, GruposUsuariosHome.java and GruposUsuariosList.java.

      And in other table that has a composite primary key:

      table auditoria
      (
      fecha date not null,
      cod_audit number(10) not null,
      descripcion varchar2(256) not null,
      aplicacion varchar2(64) not null,
      equipo varchar2(16) not null,
      primary key (fecha, cod_audit, equipo)
      )

      I get 4 files from generate-entities AuditoriaHome.java, Auditoria.java, AuditoriaList.java and AuditoriaId.java.

      When I do seam restart I receive this error among other:

      [javac] c:\DesarrolloJava\Workspace\Teldages\src\action\com\mydomain\Teldages\Auditori
      aHome.java:26: isEmpty(java.lang.String) in org.jboss.seam.util.Strings cannot be applied
      to (java.util.Date)
      [javac] if (Strings.isEmpty(getAuditoriaId().getFecha()))

      Could anyone help me? Do I have to modify the reveng.xml file?

      Thanks in advance.