java - Spring MVC custom Class property editor -


what's wrong in code?

i have bound class "fornitore fornitore" property way:

@initbinder     protected void initbinder(webdatabinder binder) {                 binder.registercustomeditor(fornitore.class, new propertyeditorsupport() {                       @override             public void setastext(string fornitoreid) throws illegalargumentexception {                 logger.info("fornitore:: setvalue");                 setvalue((fornitore) fornitoreservice.getfornitore(fornitoreid));             }             @override             public string getastext() {                 logger.info("fornitore:: getvalue");                 if (getvalue() == null) {                     return "";                 } else {                     return ((fornitore) getvalue()).getragionesociale();                 }                            }                    });     } 

ends with:

caused by: org.hibernate.lazyinitializationexception: not initialize proxy - no session     @ org.hibernate.proxy.abstractlazyinitializer.initialize(abstractlazyinitializer.java:86)     @ org.hibernate.proxy.abstractlazyinitializer.getimplementation(abstractlazyinitializer.java:140)     @ org.hibernate.proxy.pojo.javassist.javassistlazyinitializer.invoke(javassistlazyinitializer.java:190)     @ it.trew.prove.model.beans.fornitore_$$_javassist_0.getragionesociale(fornitore_$$_javassist_0.java)     @ it.trew.prove.web.controllers.scadenziariocontroller$1.getastext(scadenziariocontroller.java:56) 

i'm not sure see relation between spring databinder above , hibernate session error below. see nothing wrong data binder, doesn't have starting hibernate session.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -