4 Replies Latest reply: Mar 1, 2012 5:12 PM by Mike Brock RSS

Upgrading @ExposeEntity to @Portable has broke generics ?

Craig Greenhalgh Newbie

Hi does @Portable support generics ?

 

 

Thanks

 

Craig

  • 1. Re: Upgrading @ExposeEntity to @Portable has broke generics ?
    Mike Brock Master

    Can you expand on the problem you're having?

  • 2. Re: Upgrading @ExposeEntity to @Portable has broke generics ?
    Craig Greenhalgh Newbie

    Hi Mike,

     

    I've found two problems with upgrading for 1.3 to 2 beta:

     

    1)

     

    I had used generic base classes for my request and responses.

     

    public abstract class BaseCreateResponse<T>

    {

        private T entity;

        private boolean success;

        private List<Error> errors;

       

        public T getEntity()

        {

            return entity;

        }

       

        public void setEntity(T entity)

        {

            this.entity = entity;

        }

       

        public boolean isSuccess()

        {

            return success;

        }

     

        public void setSuccess(boolean success)

        {

            this.success = success;

        }

     

        public List<Error> getErrors()

        {

            return errors;

        }

     

        public void setErrors(List<Error> errors)

        {

            this.errors = errors;

        }

    }

     

    Then my actual reponse class would be as such

     

    @ExposeEntity

    public class GroupCreateResponse extends BaseCreateResponse<Group>

    {

    }

     

    However the generation for marshalling now fails.  I've needed to refactor all of these to had the getter and setters for "T" in the implementation classes.

     

    2)

     

    Inheritence is not recoginsed

     

    I have an abstract class "Report", which "SummaryReport" extends.  My request and response object (like above) contain just "Report", but when I set that get the values I actually use the extended classes "SummaryReport" etc.  However, generation fails as "Report" is not annotated with @Portable, nor can it as it is abstract

     

     

    Any ideas how I can achieve this ?

     

    Many thanks for your help

     

    Craig

  • 3. Re: Upgrading @ExposeEntity to @Portable has broke generics ?
    Mike Brock Master

    I will try to integrate a unit test along the lines of what you're describing and see if I can reproduce it and get back to you soon.

  • 4. Re: Upgrading @ExposeEntity to @Portable has broke generics ?
    Mike Brock Master

    This has been fixed. The 2.0-SNAPSHOT builds with this fix in it should be availabel in the next few hours.