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.ClassNotFoundException
public ItemBean create(ItemBean instance) throws java.sql.SQLException
IGenericDao
create
in interface IGenericDao<ItemBean,java.lang.Integer>
instance
- Bean objectjava.sql.SQLException
public ItemBean read(java.lang.Integer instance) throws java.sql.SQLException
IGenericDao
read
in interface IGenericDao<ItemBean,java.lang.Integer>
instance
- (PK)java.sql.SQLException
public ItemBean update(ItemBean instance) throws java.sql.SQLException
IGenericDao
update
in interface IGenericDao<ItemBean,java.lang.Integer>
instance
- Bean objectjava.sql.SQLException
public boolean delete(ItemBean instance) throws java.sql.SQLException
IGenericDao
delete
in interface IGenericDao<ItemBean,java.lang.Integer>
instance
- Bean objectjava.sql.SQLException
public java.util.List<ItemBean> getItems() throws java.sql.SQLException
IItemDao
public java.util.List<ItemBean> getHotItems(int limit) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<ItemBean> getItemsByCategory(java.lang.String name) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<ItemBean> getItemsByCategory(java.lang.String name, int limit) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<ItemBean> getItemsByCategory(int idCategory) throws java.sql.SQLException
java.sql.SQLException
public java.util.List<ItemBean> getDiscountItems() throws java.sql.SQLException
java.sql.SQLException
public java.util.List<ItemBean> getDiscountItems(int limit) throws java.sql.SQLException
java.sql.SQLException
public byte[] getItemImage(int idItem) throws java.sql.SQLException
IItemDao
getItemImage
in interface IItemDao
idItem
- (PK)java.sql.SQLException
public java.util.List<CategoryBean> getCategories() throws java.sql.SQLException
java.sql.SQLException
public CategoryBean getCategory(int id) throws java.sql.SQLException
java.sql.SQLException
public boolean deleteCategory(CategoryBean instance) throws java.sql.SQLException
java.sql.SQLException