Won't the Cart x Item relationship be a many to many relationship ?
Currently, one item can only be in one cart, right ?
You probably looking for something like this....

CREATE TABLE CART (
  ID INTEGER PRIMARY KEY,
  SUB_TOTAL DOUBLE,
  TAX DOUBLE,
  TOTAL DOUBLE
);

CREATE TABLE ITEM (
  ID INTEGER,
  DESC VARCHAR(30),
  UNITS INTEGER,
  PRICE DOUBLE
);

CREATE TABLE CART_ITEM(
  CART_ID INTEGER,
  ITEM_ID INTEGER,
  QUANTITY INTEGER,
  FOREIGN KEY (CART_ID) REFERENCES CART(ID),
  FOREIGN KEY (ITEM_ID) REFERENCES ITEM(ID)
)



--
Luciano Resende
http://people.apache.org/~lresende <http://people.apache.org/%7Elresende>

On 11/15/06, Adriano Crestani <[EMAIL PROTECTED]> wrote:

Willian, I created these tables, that will possible be used in the
shopping
cart app. It's simple, but I think a howto sample must be simple. And if
you
want to add anything, feel free ; )

CREATE TABLE CART (
    ID INTEGER,
    PRIMARY KEY (ID)
);

CREATE TABLE ITEM (
    ID INTEGER,
    ITEM VARCHAR(30),
    UNITS INTEGER,
    CART_ID INTEGER,
    PRIMARY KEY (ID),
    FOREIGN KEY (CART_ID) REFERENCES CART(ID)
);



On 11/16/06, Luciano Resende <[EMAIL PROTECTED]> wrote:
>
> Hey Guys
>
>    Very good to see some progress and some contents being generated. I
> agree
> with you guys when you say this is becoming more like a user guide,
> instead
> of a How To, and building it describing a new scenario would probably
make
> things more clear, altough let's try to keep it simple on the beginning,

> otherwise we are going to get a White paper :)
>
>    I think we should describe actions that you would take when trying to
> create an application and describe how you would do it (e.g Now we need
to
> execute a query to read the list of products, and this is how you would
do
> using DAS), and point the user to further documentation in case it
> needs/want to know more about the specific feature (e.g if they want to
> learn the whole syntax/xsd of the das config file).
>
>    I think couple things should not be covered on the How to :
>       - How to build a war file
>       - How to create a database (altough you might provide the SQL
> statements to create the tables you would use or at least describe the
DB
> schema)
>
>    Now, talking about what should be in this how-to
>       - We could start very simple... 1 product table, and one simple
jsp
> that gives you a list of the products available
>       - Using MySQL is good, altough this how to should not really be
> database dependent, right ? we could point it to any database, and you
> guys
> could maybe elaborate on what change would be necessary to do this :)
>
>    Also, I think this how to does not necessarily need to produce a
> working
> application, as it's intended to show how people would use DAS. If we
want
> to spend time creating an application, I'd suggest doing this as another
> task, and finish the one I have started as part of
> http://issues.apache.org/jira/browse/TUSCANY-800
>
> Let me know if you have any further questions... let's continue to
> updating
> the wiki, and please let me know when you guys want me to take a look
and
> provide a feedback on the contents...
>
> BTW, others are welcome to voice their opinion on what direction we
should
> take here...
>
>
> - Luciano Resende
> Apache Tuscany
>
>
> On 11/15/06, Adriano Crestani < [EMAIL PROTECTED]> wrote:
> >
> > I've decribed the XML configuration file, but it's still looking like
a
> > user
> > guide than a howto. I think the CompanyWeb sample is to simple and
> doesn't
> > cover well all the DAS features. So lets make this Shopping Cart
> > application
> > trying to use all the DAS features. Then we will be able to do a very
> > useful
> > howto.
> >
> >   My propose is that this app must have at least:
> >
> >      - 1 functionality that requires a SQL command with arguments.
Then
> we
> > cover how to deal with arguments in SQL commands.
> >
> >     - 1 table that has one autoincrement key column to cover the
> > "genarated"
> > attribute on the howto.
> >
> >     - 1 table that requires a concurrency control to cover the
> > "concurrency"
> > attribute on the howto.
> >
> >    - 1 table containing a foreign key to cover how to explicit in the
> XML
> > configuration file the link between two tables. There will probabily
be
> a
> > foreign key in its database anyway. ; )
> >
> > I think also a good idea to use the MySql as the database server, once
> > it's
> > the most used server on webapps ; )
> >
> > We must discuss how will be the Shopping Cart GUI, it must be simple
> once
> > it's not the focus of our howto. I think a simple html genarated by a
> jsp
> > is
> > enough. ; )
> >
> > Adriano Crestani
> >
> > On 11/15/06, Willian Yabusame Maja <[EMAIL PROTECTED]> wrote:
> > >
> > > Hello Tuscany Community!
> > >
> > >     Adriano Crestani and I are working together on a HelloWorld DAS
> "How
> > > To". I have uploaded what we have done so far to
> > >
> >
> 
http://wiki.apache.org/ws/Tuscany/TuscanyJava/DAS_Java_Overview/RDBDAS_HOWTO_HelloDASApp

> > >
> > >     We were using the CompanyWeb sample application to make this
> > > step-by-step how-to and teach how to use the DAS/SDO Features. We
are
> > not
> > > liking what this is becoming, as it's looking more like a
> > user-gide/readme
> > > then really a how-to, so we would like to do a new proposal :
> > >
> > >     Use the scenario of a Shopping cart, and use it to explain more
> > about
> > > how to build it using DAS to handle the persistence part of the
app...
> > >
> > >     The topics would be:
> > >         Introducing the scenario and the motivation to use DAS/SDO
> > >         Initial Setup and environment assumptions
> > >         Building the application
> > >         - database
> > >                 - DAS commands
> > >                 - Configuring the XML and how to make the commands
> > >         Explain the DAS/SDO and how to read/get results
> > >         conclusion
> > >
> > >
> > >     Before we change our path to this new approach, we would like to

> > hear
> > > some feedback on what you guys think about this new approach....
> > >
> > > Willian Yabusame Maja
> > >
> >
> >
>
>


Reply via email to