public class ItemDao extends AMysqlDao implements IItemDao
| Constructor and Description |
|---|
ItemDao() |
| Modifier and Type | Method and Description |
|---|---|
ItemBean |
create(ItemBean instance)
Create new record from object instance and save into database
|
boolean |
delete(ItemBean instance)
Delete record from database
|
boolean |
deleteCategory(CategoryBean instance) |
java.util.List<CategoryBean> |
getCategories() |
CategoryBean |
getCategory(int id) |
java.util.List<ItemBean> |
getDiscountItems() |
java.util.List<ItemBean> |
getDiscountItems(int limit) |
java.util.List<ItemBean> |
getHotItems(int limit) |
byte[] |
getItemImage(int idItem)
Get image bytes from Blob
|
java.util.List<ItemBean> |
getItems()
Get list of all items
|
java.util.List<ItemBean> |
getItemsByCategory(int idCategory) |
java.util.List<ItemBean> |
getItemsByCategory(java.lang.String name) |
java.util.List<ItemBean> |
getItemsByCategory(java.lang.String name,
int limit) |
ItemBean |
read(java.lang.Integer instance)
Loading record from database to Bean object
|
ItemBean |
update(ItemBean instance)
Update record
|
public ItemDao()
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic ItemBean create(ItemBean instance) throws java.sql.SQLException
IGenericDaocreate in interface IGenericDao<ItemBean,java.lang.Integer>instance - Bean objectjava.sql.SQLExceptionpublic ItemBean read(java.lang.Integer instance) throws java.sql.SQLException
IGenericDaoread in interface IGenericDao<ItemBean,java.lang.Integer>instance - (PK)java.sql.SQLExceptionpublic ItemBean update(ItemBean instance) throws java.sql.SQLException
IGenericDaoupdate in interface IGenericDao<ItemBean,java.lang.Integer>instance - Bean objectjava.sql.SQLExceptionpublic boolean delete(ItemBean instance) throws java.sql.SQLException
IGenericDaodelete in interface IGenericDao<ItemBean,java.lang.Integer>instance - Bean objectjava.sql.SQLExceptionpublic java.util.List<ItemBean> getItems() throws java.sql.SQLException
IItemDaopublic java.util.List<ItemBean> getHotItems(int limit) throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.List<ItemBean> getItemsByCategory(java.lang.String name) throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.List<ItemBean> getItemsByCategory(java.lang.String name, int limit) throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.List<ItemBean> getItemsByCategory(int idCategory) throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.List<ItemBean> getDiscountItems() throws java.sql.SQLException
java.sql.SQLExceptionpublic java.util.List<ItemBean> getDiscountItems(int limit) throws java.sql.SQLException
java.sql.SQLExceptionpublic byte[] getItemImage(int idItem)
throws java.sql.SQLException
IItemDaogetItemImage in interface IItemDaoidItem - (PK)java.sql.SQLExceptionpublic java.util.List<CategoryBean> getCategories() throws java.sql.SQLException
java.sql.SQLExceptionpublic CategoryBean getCategory(int id) throws java.sql.SQLException
java.sql.SQLExceptionpublic boolean deleteCategory(CategoryBean instance) throws java.sql.SQLException
java.sql.SQLException