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 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 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 your model's constructor.
>>
>> public class MyModel implements IModel {
>>
>>    @SpringBean
>>    EntityManager entityManager;
>>
>>    public MyModel() {
>>      Injector.get().inject(this);
>>    }
>>
>> ...
>> }
>>
>> This will take care of instantiating all @SpringBean annotated fields as
>> well are handle their serialization/deserialization.
>>
>> Marios
>>
>>
>>
>> On Thu, May 1, 2014 at 3:42 PM, Yahoo <hansheinrichbr...@yahoo.de> wrote:
>>
>>  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
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to