JAVA-8405: reducing logging for tutorials-build-job
This commit is contained in:
+2
-2
@@ -16,7 +16,7 @@ public class CustomInterceptor extends EmptyInterceptor {
|
||||
@Override
|
||||
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
|
||||
if (entity instanceof User) {
|
||||
logger.info(((User) entity).toString());
|
||||
logger.debug(entity.toString());
|
||||
}
|
||||
return super.onSave(entity, id, state, propertyNames, types);
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class CustomInterceptor extends EmptyInterceptor {
|
||||
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object [] previousState, String[] propertyNames, Type[] types) {
|
||||
if (entity instanceof User) {
|
||||
((User) entity).setLastModified(new Date());
|
||||
logger.info(((User) entity).toString());
|
||||
logger.debug(entity.toString());
|
||||
}
|
||||
return super.onFlushDirty(entity, id, currentState, previousState, propertyNames, types);
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,7 +1,5 @@
|
||||
package com.baeldung.hibernate.interceptors.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -9,6 +7,7 @@ import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import java.util.Date;
|
||||
|
||||
@Entity(name = "hbi_user")
|
||||
public class User {
|
||||
|
||||
+3
-3
@@ -42,9 +42,9 @@ public class HibernateHiloUnitTest {
|
||||
private void configureLogger() {
|
||||
BasicConfigurator.configure();
|
||||
LogManager.getLogger("org.hibernate").setLevel(Level.ERROR);
|
||||
LogManager.getLogger("org.hibernate.id.enhanced.SequenceStructure").setLevel(Level.DEBUG);
|
||||
LogManager.getLogger("org.hibernate.event.internal.AbstractSaveEventListener").setLevel(Level.DEBUG);
|
||||
LogManager.getLogger("org.hibernate.SQL").setLevel(Level.DEBUG);
|
||||
LogManager.getLogger("org.hibernate.id.enhanced.SequenceStructure").setLevel(Level.INFO);
|
||||
LogManager.getLogger("org.hibernate.event.internal.AbstractSaveEventListener").setLevel(Level.INFO);
|
||||
LogManager.getLogger("org.hibernate.SQL").setLevel(Level.INFO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
@@ -1,5 +1,8 @@
|
||||
package com.baeldung.hibernate.proxy;
|
||||
|
||||
import org.apache.log4j.BasicConfigurator;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.LogManager;
|
||||
import org.hibernate.*;
|
||||
import org.hibernate.proxy.HibernateProxy;
|
||||
import org.junit.After;
|
||||
|
||||
@@ -2,7 +2,7 @@ hibernate.connection.driver_class=org.h2.Driver
|
||||
hibernate.connection.url=jdbc:h2:mem:hilo_db;DB_CLOSE_DELAY=-1
|
||||
hibernate.connection.username=sa
|
||||
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||
hibernate.show_sql=true
|
||||
hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=create-drop
|
||||
hibernate.c3p0.min_size=5
|
||||
hibernate.c3p0.max_size=20
|
||||
|
||||
@@ -5,6 +5,6 @@ hibernate.connection.autocommit=true
|
||||
jdbc.password=
|
||||
|
||||
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||
hibernate.show_sql=true
|
||||
hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=create-drop
|
||||
hibernate.current_session_context_class=org.hibernate.context.internal.ThreadLocalSessionContext
|
||||
@@ -5,5 +5,5 @@ hibernate.connection.password=
|
||||
hibernate.connection.autocommit=true
|
||||
|
||||
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||
hibernate.show_sql=true
|
||||
hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=validate
|
||||
+1
-1
@@ -3,7 +3,7 @@ hibernate.connection.url=jdbc:h2:mem:mydb1;DB_CLOSE_DELAY=-1
|
||||
hibernate.connection.username=sa
|
||||
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||
|
||||
hibernate.show_sql=true
|
||||
hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=create-drop
|
||||
|
||||
hibernate.physical_naming_strategy=com.baeldung.hibernate.namingstrategy.CustomPhysicalNamingStrategy
|
||||
|
||||
@@ -3,5 +3,5 @@ hibernate.connection.url=jdbc:h2:mem:mydb1;DB_CLOSE_DELAY=-1
|
||||
hibernate.connection.username=sa
|
||||
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||
|
||||
hibernate.show_sql=true
|
||||
hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=create-drop
|
||||
@@ -5,7 +5,7 @@ hibernate.connection.autocommit=true
|
||||
jdbc.password=
|
||||
|
||||
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||
hibernate.show_sql=true
|
||||
hibernate.show_sql=false
|
||||
hibernate.hbm2ddl.auto=create-drop
|
||||
|
||||
hibernate.c3p0.min_size=5
|
||||
|
||||
Reference in New Issue
Block a user