Cart Item Problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Cart Item Problem

Shereen
Hi All
I'm having a problem related to how the objects are related to the database tables so that the object can be saved
This was very easy using minlang where you can specify what entity are you using and do the CRUDs easily
but what about the java objects how they are mapped to the database tables

I cam Across this problem while tring to do the following
I want to add two field in the OrderItem table those fields are called fromDate and toDate
I've added them to the database table through the entitymodel.xml very easily
Actually those two fields come from the quote like startReservation date for example
so I went to the service loadCartFromQuote
and added them into the cartItem Object
I don't know how to map this to the orderItem table
I mean now the cartItem contains 2 dates and the OrderItem has 2 dates how the mapping is done?
where the method that will save the cart item to order item and put it in the database?
I've searched for a while and I found that ofbiz doesn't use ORM then how it works?

I'd be grateful for a reply
Reply | Threaded
Open this post in threaded view
|

Re: Cart Item Problem

BJ Freeman
as said many times there is not object mapping into database.
learn how delegator's work.
the beauty of ofbiz frame work is once you define a new field in a
entity it is available through the delegator, in any code. No need to map.



=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man

Shereen sent the following on 1/20/2011 6:19 AM:

>
> Hi All
> I'm having a problem related to how the objects are related to the database
> tables so that the object can be saved
> This was very easy using minlang where you can specify what entity are you
> using and do the CRUDs easily
> but what about the java objects how they are mapped to the database tables
>
> I cam Across this problem while tring to do the following
> I want to add two field in the OrderItem table those fields are called
> fromDate and toDate
> I've added them to the database table through the entitymodel.xml very
> easily
> Actually those two fields come from the quote like startReservation date for
> example
> so I went to the service loadCartFromQuote
> and added them into the cartItem Object
> I don't know how to map this to the orderItem table
> I mean now the cartItem contains 2 dates and the OrderItem has 2 dates how
> the mapping is done?
> where the method that will save the cart item to order item and put it in
> the database?
> I've searched for a while and I found that ofbiz doesn't use ORM then how it
> works?
>
> I'd be grateful for a reply
>
Reply | Threaded
Open this post in threaded view
|

Re: Cart Item Problem

Shereen
Thank a lot for your answer
I'm really lost in shopping cart classes
Could you please give me any guidelines how to study specifically the delegators used regarding the shopping cart
or generally how can I  get to learn this.
Things have been much easier when I used the minilang.
even sometimes when using the java I used to make genericValue objects specify the entity and make the CRUDs operations
but in case this cartItem objects hasn't been yet in the database so I'm missing this level.
I don't know where the part that corresponds to the part of GenericValue objects and these staff
can you provide me with any links or even files from the code itself to learn and understand thanks a lot
Reply | Threaded
Open this post in threaded view
|

Re: Cart Item Problem

BJ Freeman
go over the training videos.
they explain entity engine and delegator.
also
http://ofbiz.apache.org/docs/entity.html
http://ofbiz.apache.org/docs/entityconfig.html



=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Shereen sent the following on 1/22/2011 12:07 AM:

>
> Thank a lot for your answer
> I'm really lost in shopping cart classes
> Could you please give me any guidelines how to study specifically the
> delegators used regarding the shopping cart
> or generally how can I  get to learn this.
> Things have been much easier when I used the minilang.
> even sometimes when using the java I used to make genericValue objects
> specify the entity and make the CRUDs operations
> but in case this cartItem objects hasn't been yet in the database so I'm
> missing this level.
> I don't know where the part that corresponds to the part of GenericValue
> objects and these staff
> can you provide me with any links or even files from the code itself to
> learn and understand thanks a lot

Reply | Threaded
Open this post in threaded view
|

Re: Cart Item Problem

Scott Gray-2
In reply to this post by Shereen
Hi Shereen,

ShoppingCart.makeOrderItems(boolean, boolean, LocalDispatcher) is probably the method you are looking for.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 22/01/2011, at 9:07 PM, Shereen wrote:

>
> Thank a lot for your answer
> I'm really lost in shopping cart classes
> Could you please give me any guidelines how to study specifically the
> delegators used regarding the shopping cart
> or generally how can I  get to learn this.
> Things have been much easier when I used the minilang.
> even sometimes when using the java I used to make genericValue objects
> specify the entity and make the CRUDs operations
> but in case this cartItem objects hasn't been yet in the database so I'm
> missing this level.
> I don't know where the part that corresponds to the part of GenericValue
> objects and these staff
> can you provide me with any links or even files from the code itself to
> learn and understand thanks a lot
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Cart-Item-Problem-tp3225516p3231121.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cart Item Problem

Shereen
Thanks Scott
It really worked with me and I like to share this so that other users can get benefits from that
so that anyone who would like to add something to the order item must study this method
Thanks scott Thanks freeman