Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    7
    Vote Rating
    0
    DavGut is on a distinguished road

      0  

    Default Answered: Serialization and Encapsulated ModelData

    Answered: Serialization and Encapsulated ModelData


    Hello,

    I would like to encapsulate a ModelData in another ModelData, but i got a serializable exception.
    In my example my class Company has one property "String name", and my class Employee has 2 properties : "String name" and "CompanyModelData company".

    Code:
    package com.myappli.services.modeldata;
    
    import ...;
    
    public class CompanyModelData extends BaseModelData {
    
        public static final String NAME = "name";
        
        /**
         * 
         */
        public CompanyModelData() {
            super();
        }
    
    
        public String getName() {
            return get(NAME);
        }
    
    
        public void setName(String name) {
            set(NAME, name);
        }
        
    }
    My second Class, which encapsulate the first ModelData
    Code:
    package com.myappli.services.modeldata;
    
    import ...;
    
    public class EmployeeModelData extends BaseModelData {
    
        public static final String NAME = "name";
    
    
        public static final String COMPANY = "company";
        
        /**
         * 
         */
        public EmployeeModelData() {
            super();
        }
    
    
        public String getName() {
            return get(NAME);
        }
    
    
        public void setName(String name) {
            set(NAME, name);
        }
        
        public CompanyModelData getCompany() {
            return get(COMPANY);
        }
    
    
        public void setCompany(CompanyModelData company) {
            set(COMPANY, company);
        }
        
    }
    When i try to get my Employee from the server, i got this error :

    Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'com.myappli.services.modeldata.CompanyModelData' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = com.myappli.services.modeldata.CompanyModelData@39e039e
    I did something wrong or it is not possible to encapsulate a ModelData in another one ?

    Thanks for your answer.

  2. You need to add a private unused field to your EmployeeModelData class of the type CompanyModelData. That should resovle your problem.

  3. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You need to add a private unused field to your EmployeeModelData class of the type CompanyModelData. That should resovle your problem.

  4. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    7
    Vote Rating
    0
    DavGut is on a distinguished road

      0  

    Default Working !

    Working !


    Thank you very much, it's working perfectly !