Javaweb Learning Record (12)--the interface definition of database operation of shopping mall

Source: Internet
Author: User

One, the basic interface, all the interfaces in the project inherit it

Package Blank.dao;

Import java.util.List;

Public interface Basedao<t,pk> {
Boolean insertobject (T entity);
Boolean updateobject (T entity);
Boolean DeleteObject (T entity);
Boolean Deleteobjectbyid (PK ID);
T FindByID (PK ID);
List<t> getobjects ();
List<t> getobjects (Long Startsize,long pageSize);
}
II. Interfaces for category operations

Package Blank.dao;

Import Blank.domain.Category;

Public interface CategoryDao extends Basedao<category, integer>{

}

Third, the interface of commodity operation

Package Blank.dao;

Import java.util.List;

Import Blank.domain.Category;
Import Blank.domain.Goods;

Public interface Goodsdao extends Basedao<goods, integer>{
List<goods> getobjectsbycid (Integer CID);
List<goods> getobjectsbycategory (Final category category);
}
Iv. interface of Product picture operation

Package Blank.dao;

Import java.util.List;

Import Blank.domain.Goods;
Import Blank.domain.GoodsImage;

Public interface Goodsimagedao extends Basedao<goodsimage, integer>{
List<goodsimage> Getgoodsimagebygid (Integer gid);
List<goodsimage> Getgoodsimagebygoods (final Goods entity);
}
Five, user interface
Import Blank.domain.User;

Public interface Userdao extends Basedao<user, integer>{
Verify that the user exists by user name and password
User Checklogin (String name,string Pass);
}
Six, order Operation interface

Public interface Ordersdao extends Basedao<orders, integer> {

}

Seven, order entry operation interface

Public interface Ordersitemdao extends Basedao<ordersitem, integer>{

}

Javaweb Learning Record (12)--the interface definition of database operation of shopping mall

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.