This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Add dependency | |
<dependency> | |
<groupId>p6spy</groupId> | |
<artifactId>p6spy</artifactId> | |
<version>2.1.3</version> | |
</dependency> | |
2. Add spy.properties to classpath with content: | |
# driver class name | |
realdriver=org.h2.Driver |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://docs.jboss.org/hibernate/core/3.5/reference/en/html/session-configuration.html#configuration-logging | |
Category Function | |
org.hibernate.SQL Log all SQL DML statements as they are executed | |
org.hibernate.type Log all JDBC parameters | |
org.hibernate.tool.hbm2ddl Log all SQL DDL statements as they are executed | |
org.hibernate.pretty Log the state of all entities (max 20 entities) associated with the session at flush time | |
org.hibernate.cache Log all second-level cache activity | |
org.hibernate.transaction Log transaction related activity | |
org.hibernate.jdbc Log all JDBC resource acquisition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When the dynamic-insert property is set to true , Hibernate does not include null values for properties (for properties that aren’t set by the application) during an INSERT operation. With the dynamic-update property set to true, Hibernate does not include unmodified properties in the UPDATE operation. How to enable (Hibernate 3 - just add @org.hibernate.annotations.Entity to entity): | |
@Entity | |
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true) | |
@Table (name="CAR") | |
if inheritance - @org.hibernate.annotations.Entity doesn't work if only on parent entity, should be on CHILD one | |
http://www.mkyong.com/hibernate/hibernate-dynamic-update-attribute-example/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.springframework.transaction.interceptor.TransactionAspectSupport#invokeWithinTransaction | |
------------------------------- | |
org.springframework.data.jpa.repository.support.SimpleJpaRepository#save(S) | |
org.hibernate.ejb.AbstractEntityManagerImpl#merge | |
org.hibernate.impl.SessionImpl#merge(java.lang.String, java.lang.Object) | |
org.hibernate.impl.SessionImpl#fireMerge(org.hibernate.event.MergeEvent) | |
* loop through MergeEventListener's | |
org.hibernate.event.def.DefaultMergeEventListener#onMerge(org.hibernate.event.MergeEvent) | |
org.hibernate.event.def.DefaultMergeEventListener#onMerge(org.hibernate.event.MergeEvent, java.util.Map) | |
* decide entity state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
metadata.serviceName="appengine.googleapis.com" | |
metadata.labels."appengine.googleapis.com/module_id"="worker" | |
metadata.labels."appengine.googleapis.com/version_id"="1" | |
log="appengine.googleapis.com/request_log" | |
####### one of the following: ###### | |
protoPayload.line."time":"2015-10-08T13:37:37.879Z" | |
protoPayload.resource:"workerCallback" | |
protoPayload.line.logMessage:"Reducer with shard number 1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from Batch where __key__ HAS ANCESTOR KEY(Campaign, 6273189772525568) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in pom.xm: (solution) | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.2</version> | |
<configuration> | |
<source>1.8</source> | |
<target>1.8</target> | |
<verbose>true</verbose> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<web-app> | |
<!-- Configure ContextLoaderListener to use AnnotationConfigWebApplicationContext | |
instead of the default XmlWebApplicationContext --> | |
<context-param> | |
<param-name>contextClass</param-name> | |
<param-value> | |
org.springframework.web.context.support.AnnotationConfigWebApplicationContext | |
</param-value> | |
</context-param> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.github.tennaito.rsql.misc.ArgumentFormatException; | |
import com.github.tennaito.rsql.misc.DefaultArgumentParser; | |
import java.sql.Timestamp; | |
import java.time.ZonedDateTime; | |
import java.time.format.DateTimeFormatter; | |
// default DefaultArgumentParser can't parse Timestamps :( | |
public class CustomizedArgumentParser extends DefaultArgumentParser { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An index for a MySQL CLOB column cannot be created with Liquibase createIndex at the moment, | |
since MySQL requires a length limit for this index, see http://dev.mysql.com/doc/refman/5.5/en/create-index.html | |
As a workaround, you can use the modifySql to 'fix' the sql generated like so: | |
<createIndex tableName="foo" indexName="i_foo"> | |
<column name="myClobColumn"/> | |
</createIndex> | |
<modifySql dbms="mysql"> | |
<replace replace="myClobColumn" with="myClobColumn(80)"/> | |
</modifySql> |
OlderNewer