3 Replies Latest reply on Sep 22, 2007 9:15 AM by pmuir

    Overriding EntityHome.find() results in exception

    stephen.friedrich

      This is how the find method is declared in EntityHome

      public class EntityHome<E> extends Home<EntityManager, E>
       ...
       public E find() {


      I try to override it like
      public class AuthorizationHome extends EntityHome<Authorization> {
       ...
       public Authorization find() {


      At runtime this result in
      javassist.CannotCompileException: duplicate method: find
       at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:544)
       at javassist.bytecode.ClassFile.addMethod(ClassFile.java:528)
       at javassist.util.proxy.ProxyFactory.override(ProxyFactory.java:373)
       at javassist.util.proxy.ProxyFactory.overrideMethods(ProxyFactory.java:349)
       at javassist.util.proxy.ProxyFactory.make(ProxyFactory.java:277)
       at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:164)
       at org.jboss.seam.Component.createProxyFactory(Component.java:1979)
      


      What I am trying to do (Seam 1.2.1):
      Authorization has some redundant columns, because it's expensive to retrieve those values from their original data store (web service, ldap).
      However after each find I'd like to update those values, so that when the user selects a row in the table of Authorizations she gets to see the most current values.

      Any ideas how to get around this?