3 Replies Latest reply on Apr 15, 2010 5:42 PM by kimda

    generate seam entities issue

    kimda
      Hi,

      I am working jboss seam app and I created database table and used reverse engineering. All necessary files were created, but it gave me this error:

      Property 'restrictionLogicOperator' not found

      and I get one more error.

      I got rid of that by modifying UserInfoList.xhtml file and UserInfoList.page.xml file.

      Now, I login and click the drop down menu and I have issue with delete and update functions. If I click 'delete' the delete button is gone and the page remains same and it doesn't delete.
      I created another project based on same db entity then the CRUD works fine with user_info table.

      Has anyone experience this before?

      thanks in advance.

      Daniel

        • 1. Re: generate seam entities issue
          kimda
          I need to add some additional explanation here.
          So, basically update and delete functionalities don't work. But create and list works correctly.

          '
          @Name("userInfoHome")
          public class UserInfoHome extends EntityHome<UserInfo> {
          ...
          ...
          ...
          '
          • 2. Re: generate seam entities issue
            gaborj

            Do you have some log output with exceptions?  Are your page navigation set in page.xml files correctly? Try to output some logs if the update and delete action methods get called on your Home.

            • 3. Re: generate seam entities issue
              kimda
              Do you have some log output with exceptions?
              >>No

              Are your page navigation set in page.xml files correctly?
              >>I am not using pages.xml. I am using xxx.page.xml files that were created by Seam automatically


              Try to output some logs if the update and delete action methods get called on your Home.
              >>It doesn't even get called. I don't see anything in console either.



              So, I added link instead of button like this:
              '
              <s:link view="/UserInfoList.xhtml" action="#{userInfoHome.delete}"
                             value="delete">
                        </s:link>
              '

              and added this in UserInfoHome class(copied this from EnitityHome class):
              '
              @Transactional
                   public String delete() {
                        System.out.println("removed called");

                        getEntityManager().remove( getInstance() );
                        getEntityManager().flush();
                        deletedMessage();
                        raiseAfterTransactionSuccessEvent();
                        return "removed";
                   }
              '

              This func get called and it doesn't delete.

              However, I did same thing for the update functionality like this(copied this from EnitityHome class):

              '
                   public String update(){

                        System.out.println("update called");
                        if ( getEntityManager().isOpen() )
                         {
                             System.out.println("getEntityManager opened!");
                            try
                            {
                               Transaction.instance().enlist(   getEntityManager() );
                            }
                            catch (SystemException se)
                            {
                                 System.out.println("SystemException====!!!");
                               throw new RuntimeException("could not join transaction", se);
                            }
                         }else{
                              System.out.println("getEntityManager closed!");
                         }
                        
                        getEntityManager().flush();
                        updatedMessage();
                        raiseAfterTransactionSuccessEvent();
                        return "updated";
                   }
              '
              but this method get called get called and gave me something in the console:

              '
              10:36:23,537 INFO  [STDOUT] Hibernate:
                  select
                      userinfo0_.USER_INFO_ID as USER1_47_0_,
                      userinfo0_.NOTE as NOTE47_0_,
                      userinfo0_.CREATED_DATE as CREATED3_47_0_,
                      userinfo0_.AGENCY_NAME as AGENCY4_47_0_,
                      userinfo0_.USER_ID as USER5_47_0_,
                      userinfo0_.USER_PASSWORD as USER6_47_0_,
                      userinfo0_.LAST_NAME as LAST7_47_0_,
                      userinfo0_.FIRST_NAME as FIRST8_47_0_,
                      userinfo0_.PRIVIL_LEVEL as PRIVIL9_47_0_,
                      userinfo0_.EMAIL as EMAIL47_0_
                  from
                      KELC_OWNER.USER_INFO userinfo0_
                  where
                      userinfo0_.USER_INFO_ID=?
              '

              but it didn't update at all.

              So, I am trying to find either:

              1. issue with delete and update with h:commandButton

              2. issue override update() func in UserInfoHome class.

              thanks,