Page 1 of 1

Technical details on extending model

Posted: Sun Nov 10, 2013 6:16 pm
by igo
Hi, can somebody explain in detail how does extending model works? How is it possible and why just creating new entity class and setting it as spring prototype works?

Re: Technical details on extending model

Posted: Mon Nov 11, 2013 11:33 am
by phillipuniverse
You're not only adding it as a spring bean. You're also hooking it up into Hibernate's persistent model (which is why you have to make an entry in your persistence.xml).

The modification to the Spring bean is so that Broadleaf knows the exact type it should create programmatically. For instance, when you create a new Order instead of Broadleaf just saying 'new OrderImpl()' it instead looks up in Spring what class it should instantiate and then persists that to the DB.