remove comments
This commit is contained in:
parent
09eaca9914
commit
567a71fdbc
persistence-modules/spring-data-jpa-crud/src/main
@ -17,7 +17,6 @@ import org.hibernate.annotations.SQLDelete;
|
|||||||
@Entity
|
@Entity
|
||||||
@Table(name = "tbl_products")
|
@Table(name = "tbl_products")
|
||||||
@SQLDelete(sql = "UPDATE tbl_products SET deleted = true WHERE id=?")
|
@SQLDelete(sql = "UPDATE tbl_products SET deleted = true WHERE id=?")
|
||||||
// @Where(clause = "deleted=false")
|
|
||||||
@FilterDef(name = "deletedProductFilter", parameters = @ParamDef(name = "isDeleted", type = "boolean"))
|
@FilterDef(name = "deletedProductFilter", parameters = @ParamDef(name = "isDeleted", type = "boolean"))
|
||||||
@Filter(name = "deletedProductFilter", condition = "deleted = :isDeleted")
|
@Filter(name = "deletedProductFilter", condition = "deleted = :isDeleted")
|
||||||
public class Product implements Serializable {
|
public class Product implements Serializable {
|
||||||
|
1
persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java
1
persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java
@ -25,7 +25,6 @@ public class ProductService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Iterable<Product> findAll(boolean isDeleted){
|
public Iterable<Product> findAll(boolean isDeleted){
|
||||||
//return productRepository.findAll();
|
|
||||||
Session session = entityManager.unwrap(Session.class);
|
Session session = entityManager.unwrap(Session.class);
|
||||||
Filter filter = session.enableFilter("deletedProductFilter");
|
Filter filter = session.enableFilter("deletedProductFilter");
|
||||||
filter.setParameter("isDeleted", isDeleted);
|
filter.setParameter("isDeleted", isDeleted);
|
||||||
|
@ -5,18 +5,5 @@ spring.jpa.properties.hibernate.order_inserts=true
|
|||||||
spring.jpa.properties.hibernate.order_updates=true
|
spring.jpa.properties.hibernate.order_updates=true
|
||||||
spring.jpa.properties.hibernate.generate_statistics=true
|
spring.jpa.properties.hibernate.generate_statistics=true
|
||||||
|
|
||||||
# JPA-Schema-Generation
|
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
||||||
# Use below configuration to generate database schema create commands based on the entity models
|
|
||||||
# and export them into the create.sql file
|
|
||||||
#spring.jpa.properties.javax.persistence.schema-generation.scripts.action=create
|
|
||||||
#spring.jpa.properties.javax.persistence.schema-generation.scripts.create-target=create.sql
|
|
||||||
#spring.jpa.properties.javax.persistence.schema-generation.scripts.create-source=metadata
|
|
||||||
#spring.jpa.properties.hibernate.format_sql=true
|
|
||||||
|
|
||||||
# spring.datasource.url=jdbc:mysql://localhost:3306/db_products?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
|
|
||||||
# spring.datasource.username=root
|
|
||||||
# spring.datasource.password=root
|
|
||||||
|
|
||||||
# spring.jpa.hibernate.ddl-auto= update
|
|
||||||
|
|
||||||
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
|
|
Loading…
x
Reference in New Issue
Block a user