Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-18 Thread Piratenvisier
Am 17.05.2014 23:08, schrieb mscoon: I don't understand what these lines are doing. Are you reloading whatever is already stored in your modelObject.kunde and setting it again to your model object? Why? all ONETOMANY relationships which are set before I open the form cause problem with

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-18 Thread Paul Borș
Are you not using a LoadableDetacheble model? And are you familiar with Hibernate's laizy loading? Have a great day, Paul Bors On May 18, 2014, at 6:08 AM, Piratenvisier hansheinrichbr...@yahoo.de wrote: Am 17.05.2014 23:08, schrieb mscoon: I don't understand what these lines are doing.

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-17 Thread mscoon
I don't understand what these lines are doing. Are you reloading whatever is already stored in your modelObject.kunde and setting it again to your model object? Why? On Thu, May 8, 2014 at 7:50 AM, Piratenvisier hansheinrichbr...@yahoo.dewrote: If I include the folowing lines :

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-16 Thread Piratenvisier
If I include the folowing lines : if(NachweiseForm.this.getModelObject().getKunde()!=null) { Kunde kunde = kundeManager.get(NachweiseForm.this.getModelObject().getKunde().getId()); NachweiseForm.this.getModelObject().setKunde(kunde);

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-15 Thread Yahoo
If I include the folowing lines : if(NachweiseForm.this.getModelObject().getKunde()!=null) { Kunde kunde = kundeManager.get(NachweiseForm.this.getModelObject().getKunde().getId()); NachweiseForm.this.getModelObject().setKunde(kunde);

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-15 Thread Adam Hammer
On May 1, 2014 6:01 AM, mscoon msc...@gmail.com wrote: Heiner, You didn't tell us which dependency injection framework you you using. If you're using Spring then simply use the @SpringBean annotation to get a reference to an EntityManager or a Dao. @SpringBean automatically works only

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-13 Thread Stefan Renz
Hi, Piratenvisier wrote: If I include the folowing lines : if(NachweiseForm.this.getModelObject().getKunde()!=null) { Kunde kunde = kundeManager.get(NachweiseForm.this.getModelObject().getKunde().getId()); NachweiseForm.this.getModelObject().setKunde(kunde);

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-12 Thread Piratenvisier
If I include the folowing lines : if(NachweiseForm.this.getModelObject().getKunde()!=null) { Kunde kunde = kundeManager.get(NachweiseForm.this.getModelObject().getKunde().getId()); NachweiseForm.this.getModelObject().setKunde(kunde);

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-05 Thread Yahoo
First I have to tell you concerning the mapping I used the wrong word the dependencies in the mapping are not recursive bur circular. Am 04.05.2014 22:24, schrieb mscoon: I'm not sure I see something wrong in your code, but then again you have omitted a lot of stuff which could be cruicial.

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-05 Thread mscoon
In a previous message you sent the following snippets: //@XmlTransient @ManyToOne(cascade = CascadeType.MERGE,fetch=FetchType.LAZY) @JoinColumn(name=NachKundNr,insertable=false, updatable=false) public Kunde getKunde(){ return this.kunde; } recursive Part for Kunde @XmlTransient

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-05 Thread Yahoo
Am 05.05.2014 11:05, schrieb mscoon: In a previous message you sent the following snippets: //@XmlTransient @ManyToOne(cascade = CascadeType.MERGE,fetch=FetchType.LAZY) @JoinColumn(name=NachKundNr,insertable=false, updatable=false) public Kunde getKunde(){ return this.kunde;

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-05 Thread mscoon
This is a hibernate issue, not a wicket issue. As I said before I am now 99% sure the problem is with the way you are using hibernate. The bug you are getting is not caused by the line you highlighted. The line Kunde kunde=kundeManager.get(new Long(pars.get(kundennr).toString())); executes a

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-05 Thread mscoon
​Actually what I said below is wrong because this line is after the line that throws the exception. But my explanation still holds. Something before the line that is throwing the exception is causing an object with a reference to a new ​Nachweise to be saved while the Nachweise is still unsaved.

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-04 Thread Yahoo
It's the solution for all MANYTOONE-Fields defined in the Form I have a MANYTOONE-Field which is preset and not set in the Form. This field is not stored. Am 02.05.2014 01:24, schrieb mscoon: No you don't. The referenced objects will be serialized along with the entity you are serializing and

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-04 Thread mscoon
Usually this is not a problem. But maybe you are doing something different that the usual. I think you will need to show us your code to help you any further. On Sun, May 4, 2014 at 9:12 AM, Yahoo hansheinrichbr...@yahoo.de wrote: It's the solution for all MANYTOONE-Fields defined in the Form

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-04 Thread Yahoo
I have a suspicion: I have defened all dependencies with jpa or hibernate annotation. So I have also a lot of cicular dependencies, which sometimes make problem. I will give you 2 examples. one which is OK when I use AbstractEntityModel and on which makes problem, which is not set in the form

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-04 Thread Yahoo
I have a suspicion: I have defened all dependencies with jpa or hibernate annotation. So I have also a lot of cicular dependencies, which sometimes make problem. I will give you 2 examples. one which is OK when I use AbstractEntityModel and on which makes problem, which is not set in the form

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-04 Thread mscoon
I'm not sure I see something wrong in your code, but then again you have omitted a lot of stuff which could be cruicial. Does nachweiseform have any components that show/update kunde? What exactly do you mean by saying after save it disappears? Has it been stored correctly in the database or is

problem with AbstractEntityModel from Igor Vaynberg

2014-05-01 Thread Yahoo
I tried the AbstractEntityModel http://http://wicketinaction.com/2008/09/building-a-smart-entitymodel/ from Igor Vaynberg but I didn't get solved the @Dependency annotation from Vaynbergs salve. Is there another solution for the Hibernate integration for models. Best regards Heiner

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-01 Thread mscoon
Heiner, You didn't tell us which dependency injection framework you you using. If you're using Spring then simply use the @SpringBean annotation to get a reference to an EntityManager or a Dao. @SpringBean automatically works only for components so you'll also need to add a call to injector to

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-01 Thread Yahoo
Ok,thank you, that's it. My Entity has a lot of MANYTOONE relationships which are set byDropDownChoices. In the case of a new entity, do I have to load all these Entities too and to save their ids ? Am 01.05.2014 15:01, schrieb mscoon: Heiner, You didn't tell us which dependency injection

Re: problem with AbstractEntityModel from Igor Vaynberg

2014-05-01 Thread mscoon
No you don't. The referenced objects will be serialized along with the entity you are serializing and everything should work just fine. On Thu, May 1, 2014 at 10:30 PM, Yahoo hansheinrichbr...@yahoo.de wrote: Ok,thank you, that's it. My Entity has a lot of MANYTOONE relationships which