0% found this document useful (0 votes)
17 views1 page

Hibernate&struts 2

This Java class removes a product from the database. It takes in a product object, uses a ProductDao to delete that product from the database, and returns SUCCESS if completed successfully. The class retrieves the product to delete, calls the delete method on the DAO, and returns success on completion.

Uploaded by

Fabiano Farah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Hibernate&struts 2

This Java class removes a product from the database. It takes in a product object, uses a ProductDao to delete that product from the database, and returns SUCCESS if completed successfully. The class retrieves the product to delete, calls the delete method on the DAO, and returns success on completion.

Uploaded by

Fabiano Farah
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

RemoveProduct.

java

package br.struts2.controller.product;

import br.hibernate.beans.Product;

public class RemoveProduct extends ActionSupport {

private static final long serialVersionUID = 1L;

private Product product;


private ProductDao productDao = new ProductDao();

public RemoveProduct() {}

@Override
public String execute() throws Exception {

productDao.removeProduct(product);

return SUCCESS;
}

public Product getProduct() {


return product;
}

public void setProduct(Product product) {


this.product = product;
}

public ProductDao getProductDao() {


return productDao;
}

public void setProductDao(ProductDao productDao) {


this.productDao = productDao;
}

Page 1

You might also like