json - How to create a custom @jsonDeserializer class in java -


i have java class. related many other java classes. , want deserialize class. please me deserialize class. class this..

@entity @table(name = "a", uniqueconstraints = @uniqueconstraint(columnnames = { "name" })) @jsonidentityinfo(generator=objectidgenerators.intsequencegenerator.class, property="@_refid") @jsondeserialize(using=adeserializer.class) public class {

@column(name = "name") private string name;  @column(name = "description") private string description; 

//

@manytomany(cascade={cascadetype.remove, cascadetype.merge},fetch=fetchtype.eager) @jointable(         name="b",         joincolumns={@joincolumn(name="aname")},         inversejoincolumns={@joincolumn(name="bname", unique=true)}     ) @fetch(fetchmode.subselect) private set<c> cs;  @manytomany(cascade={cascadetype.merge},fetch=fetchtype.eager) @jointable(         name="d",         joincolumns=@joincolumn(name="aname"),         inversejoincolumns=@joincolumn(name="ename")     ) @fetch(fetchmode.subselect) private set<e> es;  @cascade({org.hibernate.annotations.cascadetype.delete_orphan}) @manytomany(cascade={cascadetype.all, cascadetype.merge},fetch=fetchtype.eager) @jointable(         name="f",         joincolumns=@joincolumn(name="aname"),         inversejoincolumns=@joincolumn(name="fname")     ) @fetch(fetchmode.subselect) private set<f> fs;    // getters , setters 

}

saying clearly...

 class {         object of class b;         object of class c {                   set<classb> bs;                objects of class c;                object of class           }        other local variables;        objects of class d{              set<classb> ds;         } 

//getters , setters

}

my rest service is

@requestmapping(value="/savea", method=requestmethod.post ) public @responsebody miresponse savea(@requestbody a) throws exception{

    return null; } 


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -