Schauen wir uns zuerst die Renderings an:
1.SQL
①t_orderItem ein Fremdschlüssel
Bname: bequem bis nach dem Buch gelöscht
Erstellen Sie Tabelle `t_orderItem` (` orderItemid` char (32) nicht null, `quantity` int (11) Standardnull,` subtotal` decimal (8,2) Standardnull, `bid` char (32) Standardnull,` bname 'varchary (200) standardnull, `currprice #` currprice `currprice #` currprice # `currprice` currprice # `currprice #` currprice # `currprice #` currprice # `currprice #` currprice # `currprice #` currprice # `currprice #` currprice # `currprice` varchar(100) DEFAULT NULL, `oid` char(32) DEFAULT NULL, PRIMARY KEY (`orderItemId`), KEY `FK_t_orderitem_t_order` (`oid`), CONSTRAINT `FK_t_orderitem_t_order` FOREIGN KEY (`oid`) REFERENCES `t_order` (`oid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; Einfügen in `t_orderItem` (` orderItemid`, `quantity`,` subtotal`, `bid`,` bname`, `currprice`,` image_b`, `oid`) Werte ('01D2DF3E5BB34E9F9D2477180C8D94D3', 1, '74 .50 ',' CE01F15D435A4C51B0AD8202A318DCA7 ',' JAVA -Programmierideen (4th) Ausgabe) ',' 74.50 ',' book_img/9317290-1_b.jpg ',' C0841f4dfe7a43bfb183e4e82ae7914c ');②t_order einen Fremdschlüssel
CREATE TABLE `t_order` ( `oid` char(32) NOT NULL, `ordertime` char(19) DEFAULT NULL, `total` decimal(10,2) DEFAULT NULL, `status` int(11) DEFAULT NULL, `address` varchar(1000) DEFAULT NULL, `uid` char(32) DEFAULT NULL, PRIMARY KEY (`oid`), KEY `Fk_t_order_t_user` (` uid`), Einschränkung `fk_t_order_t_user` fremd key (` uid`) referenzen `t_user` (` uid`)) Engine = innoDB default charset = utf8; Einfügen in "t_order" (`oid`,` ordertime`, `Total`,` status`, `adress`,` uid`) Werte ('058f48da33694c6d8f5c2c13f3d26cea “, 2013-12-26 21:47:04', ' XXX ',' 32DB3700D2564254982BC58B0E4D95BC ');2.Bean
①orderItem
öffentliche Klasse OrderItem {private String orderItemid; // Primärschlüssel private int Menge; // Quantität Private Double Subtotal; // Subtotal Private Book Book; // Zugeordnete Buch Private Order; // Bestellung zu gehören②ORDER
Öffentliche Klasse {private String oid; // Grundschlüssel private String -Auftragszeit; // Bestellzeit private doppelte Gesamtsumme; // Total Private Int Status; // Bestellstatus: 1 Nicht bezahlt, 2 nicht geliefert, aber nicht versendet, 3 nicht versandt, erhalten durch Versand, erhalten durch Versand, erhalten durch Versand, erhalten von 4 bestätigten, dass die Transaktion erfolgreich ist, 5 Stornierte. LIST <Roderitem> OrderItemList;Das obige ist der gesamte Inhalt dieses Artikels. Ich hoffe, es wird für das Lernen aller hilfreich sein und ich hoffe, jeder wird Wulin.com mehr unterstützen.