java - hibernate - could not execute statement; SQL [n/a] - saving nested object -


i'm trying save nested object using hibernate , receive could not execute statement; sql [n/a] exception

code

@entity @table(name = "listing") @inheritance(strategy = inheritancetype.joined) public class listing implements serializable {    @id   @column(name = "listing_id")   private string listingid;    @column(name = "property_type")   private propertytype propertytype;    @column(name = "category")   private category category;    @column(name = "price_currency")   private string pricecurrency;    @column(name = "price_value")   private double pricevalue;    @column(name = "map_point")   private mappoint mappoint;    @column(name = "commission_fee_info")   private commissionfeeinfo commissionfeeinfo; }   public class mappoint implements serializable {    private final float latitude;   private final float longitude; }  public class commissionfeeinfo implements serializable {    private string agentfeeinfo;   private commissionfeetype commissionfeetype;   private double value;   private double commissionfee; }  public enum commissionfeetype implements serializable { } 

using razorsql saw hibernate defines mappoint , commissionfee varbinary

what can't understand, fact hibernate manages save when commissionfeeinfo not present. has no problem saving mappoint

does have idea wrong?

update

i found out if attributes of commissionfeeinfo excepting agentfeeinfoare null, object saved without problems. if 1 of other attributes != null, errors occur.

update 2

i changed type of attributes of commissionfeeinfo string , object saved without problem, can't let attributes string.

i solved problem adding setting

@column(name = "commission_fee_info", columndefinition = "longvarbinary") 

as annotation field commisionfeeinfo in class listing


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -