...
 
Commits (3)
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<aspectj.version>1.8.9</aspectj.version> <aspectj.version>1.8.9</aspectj.version>
<mysql.version>5.1.46</mysql.version> <postgres.version>42.2.5</postgres.version>
<hazelcast.version>3.8.1</hazelcast.version> <hazelcast.version>3.8.1</hazelcast.version>
<oval.version>1.81</oval.version> <oval.version>1.81</oval.version>
...@@ -363,9 +363,9 @@ ...@@ -363,9 +363,9 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>org.postgresql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>postgresql</artifactId>
<version>${mysql.version}</version> <version>${postgres.version}</version>
</dependency> </dependency>
<!--Other dependencies --> <!--Other dependencies -->
......
...@@ -46,13 +46,13 @@ public class DSRow implements EntityId { ...@@ -46,13 +46,13 @@ public class DSRow implements EntityId {
private List<DSValue<?>> values; private List<DSValue<?>> values;
@Id @Id
@GeneratedValue(strategy = GenerationType.TABLE) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
@Column(columnDefinition = "binary(16)", updatable = false) @Column(updatable = false, length=16)
private byte[] md5; private byte[] md5;
@Column(columnDefinition = "binary(20)", updatable = false) @Column(updatable = false, length=20)
private byte[] sha1; private byte[] sha1;
@PrePersist @PrePersist
......
...@@ -32,7 +32,7 @@ import javax.persistence.Table; ...@@ -32,7 +32,7 @@ import javax.persistence.Table;
@DiscriminatorColumn(discriminatorType = DiscriminatorType.INTEGER, name = "typ") @DiscriminatorColumn(discriminatorType = DiscriminatorType.INTEGER, name = "typ")
public abstract class DSRowQualifier<T> { public abstract class DSRowQualifier<T> {
@Id @Id
@GeneratedValue(strategy = GenerationType.TABLE) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
@ManyToOne(fetch=FetchType.LAZY, optional = false) @ManyToOne(fetch=FetchType.LAZY, optional = false)
......
...@@ -20,7 +20,7 @@ import javax.persistence.Table; ...@@ -20,7 +20,7 @@ import javax.persistence.Table;
@DiscriminatorColumn(discriminatorType = DiscriminatorType.INTEGER, name = "typ") @DiscriminatorColumn(discriminatorType = DiscriminatorType.INTEGER, name = "typ")
public abstract class DSValue<T> { public abstract class DSValue<T> {
@Id @Id
@GeneratedValue(strategy = GenerationType.TABLE) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
@ManyToOne(fetch=FetchType.LAZY, optional = false) @ManyToOne(fetch=FetchType.LAZY, optional = false)
......
...@@ -40,7 +40,7 @@ public class DimensionKey implements EntityId, Serializable { ...@@ -40,7 +40,7 @@ public class DimensionKey implements EntityId, Serializable {
private static final long serialVersionUID = 1232115638223004469L; private static final long serialVersionUID = 1232115638223004469L;
@Id @Id
@GeneratedValue(strategy = GenerationType.TABLE) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
@Column(length = 100, nullable = false, updatable = false) @Column(length = 100, nullable = false, updatable = false)
......
...@@ -52,7 +52,7 @@ public class Observation implements EntityId, Serializable { ...@@ -52,7 +52,7 @@ public class Observation implements EntityId, Serializable {
private static final long serialVersionUID = -7621192124417368090L; private static final long serialVersionUID = -7621192124417368090L;
@Id @Id
@GeneratedValue(strategy = GenerationType.TABLE) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
@Column(name = "`value`") @Column(name = "`value`")
......
...@@ -32,37 +32,37 @@ public interface Taxonomy2Repository extends JpaRepository<Taxonomy2, Long> { ...@@ -32,37 +32,37 @@ public interface Taxonomy2Repository extends JpaRepository<Taxonomy2, Long> {
@Query("select distinct t.genus from Taxonomy2 t where t.genus like ?1") @Query("select distinct t.genus from Taxonomy2 t where t.genus like ?1")
List<String> autocompleteGenus(String term, Pageable page); List<String> autocompleteGenus(String term, Pageable page);
@Query("select distinct t.genus from Taxonomy2 t join t.cropTaxonomies ct where t.genus like ?1 and ct.crop = ?2") @Query("select distinct t.genus from Taxonomy2 t join t.cropTaxonomies ct where lower(t.genus) like lower(?1) and ct.crop = ?2")
List<String> autocompleteGenusByCrop(String term, Crop crop, Pageable page); List<String> autocompleteGenusByCrop(String term, Crop crop, Pageable page);
@Query("select distinct t.species from Taxonomy2 t where t.species like ?1)") @Query("select distinct t.species from Taxonomy2 t where lower(t.species) like lower(?1)")
List<String> autocompleteSpecies(String term, Pageable page); List<String> autocompleteSpecies(String term, Pageable page);
@Query("select distinct t.species from Taxonomy2 t join t.cropTaxonomies ct where t.species like ?1 and ct.crop = ?2") @Query("select distinct t.species from Taxonomy2 t join t.cropTaxonomies ct where lower(t.species) like lower(?1) and ct.crop = ?2")
List<String> autocompleteSpeciesByCrop(String term, Crop crop, Pageable page); List<String> autocompleteSpeciesByCrop(String term, Crop crop, Pageable page);
@Query("select distinct t.species from Taxonomy2 t where t.species like ?1 and t.genus in (?2)") @Query("select distinct t.species from Taxonomy2 t where lower(t.species) like lower(?1) and t.genus in (?2)")
List<String> autocompleteSpeciesByGenus(String term, List<String> genus, Pageable page); List<String> autocompleteSpeciesByGenus(String term, List<String> genus, Pageable page);
@Query("select distinct t.taxonName from Taxonomy2 t where t.taxonName like ?1)") @Query("select distinct t.taxonName from Taxonomy2 t where lower(t.taxonName) like lower(?1)")
List<String> autocompleteTaxonomy(String term, Pageable page); List<String> autocompleteTaxonomy(String term, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1)") @Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1)")
List<String> autocompleteSubtaxa(String string, Pageable page); List<String> autocompleteSubtaxa(String string, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t join t.cropTaxonomies ct where t.subtaxa like ?1 and ct.crop = ?2") @Query("select distinct t.subtaxa from Taxonomy2 t join t.cropTaxonomies ct where lower(t.subtaxa) like lower(?1) and ct.crop = ?2")
List<String> autocompleteSubtaxaByCrop(String string, Crop crop, Pageable page); List<String> autocompleteSubtaxaByCrop(String string, Crop crop, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1 and t.genus in (?2)") @Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1) and t.genus in (?2)")
List<String> autocompleteSubtaxaByGenus(String string, List<String> genus, Pageable page); List<String> autocompleteSubtaxaByGenus(String string, List<String> genus, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1 and t.species in (?2)") @Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1) and t.species in (?2)")
List<String> autocompleteSubtaxaBySpecies(String string, List<String> species, Pageable page); List<String> autocompleteSubtaxaBySpecies(String string, List<String> species, Pageable page);
@Query("select distinct t.subtaxa from Taxonomy2 t where t.subtaxa like ?1 and t.genus in (?2) and t.species in (?3)") @Query("select distinct t.subtaxa from Taxonomy2 t where lower(t.subtaxa) like lower(?1) and t.genus in (?2) and t.species in (?3)")
List<String> autocompleteSubtaxaByGenusAndSpecies(String string, List<String> genus, List<String> species, Pageable page); List<String> autocompleteSubtaxaByGenusAndSpecies(String string, List<String> genus, List<String> species, Pageable page);
@Query("select t from Taxonomy2 t where t.genus = ?1 and t.species = ?2 and t.spAuthor = ?3 and t.subtaxa = ?4 and t.subtAuthor = ?5") @Query("select t from Taxonomy2 t where lower(t.genus) = lower(?1) and lower(t.species) = lower(?2) and lower(t.spAuthor) = lower(?3) and lower(t.subtaxa) = lower(?4) and lower(t.subtAuthor) = lower(?5)")
Taxonomy2 findByGenusAndSpeciesAndSpAuthorAndSubtaxaAndSubtAuthor(String genus, String species, String spAuthor, String subtaxa, String subtAuthor); Taxonomy2 findByGenusAndSpeciesAndSpAuthorAndSubtaxaAndSubtAuthor(String genus, String species, String spAuthor, String subtaxa, String subtAuthor);
List<Taxonomy2> findByGenus(String genus); List<Taxonomy2> findByGenus(String genus);
......
...@@ -251,8 +251,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -251,8 +251,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters()); final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters());
apss.setValues(stmt); apss.setValues(stmt);
// Set mysql JConnector to stream results
stmt.setFetchSize(Integer.MIN_VALUE);
return stmt; return stmt;
} }
}, rowCallbackHandler); }, rowCallbackHandler);
...@@ -277,8 +275,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -277,8 +275,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters()); final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters());
apss.setValues(stmt); apss.setValues(stmt);
// Set mysql JConnector to stream results
// stmt.setFetchSize(Integer.MIN_VALUE);
return stmt; return stmt;
} }
}, rowCallbackHandler); }, rowCallbackHandler);
...@@ -305,8 +301,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -305,8 +301,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters()); final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters());
apss.setValues(stmt); apss.setValues(stmt);
// Set mysql JConnector to stream results
stmt.setFetchSize(Integer.MIN_VALUE);
return stmt; return stmt;
} }
}, rowCallbackHandler); }, rowCallbackHandler);
...@@ -332,8 +326,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -332,8 +326,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters()); final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters());
apss.setValues(stmt); apss.setValues(stmt);
// Set mysql JConnector to stream results
stmt.setFetchSize(Integer.MIN_VALUE);
return stmt; return stmt;
} }
}, rowCallbackHandler); }, rowCallbackHandler);
...@@ -346,8 +338,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -346,8 +338,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
public PreparedStatement createPreparedStatement(final Connection con) throws SQLException { public PreparedStatement createPreparedStatement(final Connection con) throws SQLException {
final PreparedStatement stmt = con final PreparedStatement stmt = con
.prepareStatement("select n.accessionId, n.instCode, n.name, n.aliasType, n.lang, n.version, n.id from accession_alias n order by n.accessionId"); .prepareStatement("select n.accessionId, n.instCode, n.name, n.aliasType, n.lang, n.version, n.id from accession_alias n order by n.accessionId");
// Set mysql JConnector to stream results
stmt.setFetchSize(Integer.MIN_VALUE);
return stmt; return stmt;
} }
}, rowCallbackHandler); }, rowCallbackHandler);
...@@ -375,8 +365,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -375,8 +365,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters()); final ArgumentPreparedStatementSetter apss = new ArgumentPreparedStatementSetter(directQuery.getParameters());
apss.setValues(stmt); apss.setValues(stmt);
// Set mysql JConnector to stream results
stmt.setFetchSize(Integer.MIN_VALUE);
return stmt; return stmt;
} }
}, rowCallbackHandler); }, rowCallbackHandler);
...@@ -390,8 +378,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -390,8 +378,6 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final PreparedStatement stmt = con final PreparedStatement stmt = con
.prepareStatement("select distinct a.id, a.instCode, a.acceNumb, t.genus from accessiontrait at inner join accession a on a.id=at.accessionId left outer join taxonomy2 t on t.id=a.taxonomyId2 where at.metadataId = ?"); .prepareStatement("select distinct a.id, a.instCode, a.acceNumb, t.genus from accessiontrait at inner join accession a on a.id=at.accessionId left outer join taxonomy2 t on t.id=a.taxonomyId2 where at.metadataId = ?");
stmt.setLong(1, id); stmt.setLong(1, id);
// Set mysql JConnector to stream results
stmt.setFetchSize(Integer.MIN_VALUE);
return stmt; return stmt;
} }
}, rowCallbackHandler); }, rowCallbackHandler);
......
...@@ -114,8 +114,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository { ...@@ -114,8 +114,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
return this.jdbcTemplate.query(new PreparedStatementCreator() { return this.jdbcTemplate.query(new PreparedStatementCreator() {
@Override @Override
public PreparedStatement createPreparedStatement(Connection conn) throws SQLException { public PreparedStatement createPreparedStatement(Connection conn) throws SQLException {
final PreparedStatement pst = conn.prepareStatement("select accessionId, `" + method.getFieldName() + "` as traitvalue from `" + method.getId() final PreparedStatement pst = conn.prepareStatement("select accessionId, \"" + method.getFieldName().toLowerCase() + "\" as traitvalue from \"" + method.getId()
+ "` where metadataId=?"); + "\" where metadataId=?");
pst.setLong(1, metadataId); pst.setLong(1, metadataId);
return pst; return pst;
} }
...@@ -139,8 +139,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository { ...@@ -139,8 +139,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
for (final AccessionTrait at : accessionTraits) { for (final AccessionTrait at : accessionTraits) {
final Method method = methodRepository.findOne(at.getMethodId()); final Method method = methodRepository.findOne(at.getMethodId());
final List<Map<String, Object>> rows = this.jdbcTemplate.queryForList("select metadataId, `" + method.getFieldName() + "` as traitvalue from `" final List<Map<String, Object>> rows = this.jdbcTemplate.queryForList("select metadataid, \"" + method.getFieldName().toLowerCase() + "\" as traitvalue from \""
+ method.getId() + "` where accessionId=?", new Object[] { at.getAccession().getId() }); + method.getId() + "\" where accessionId=?", new Object[] { at.getAccession().getId() });
if (rows == null || rows.size() == 0) { if (rows == null || rows.size() == 0) {
// Skip // Skip
...@@ -186,8 +186,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository { ...@@ -186,8 +186,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
final long methodId = method.getId(); final long methodId = method.getId();
LOG.debug("MethodID={}", methodId); LOG.debug("MethodID={}", methodId);
this.namedJdbcTemplate.query("select accessionId, `" + method.getFieldName() + "` as traitvalue from `" + method.getId() this.namedJdbcTemplate.query("select accessionid, \"" + method.getFieldName().toLowerCase() + "\" as traitvalue from \"" + method.getId()
+ "` where metadataId = :metadataId and accessionId in ( :accessionIds )", paramMap, new RowCallbackHandler() { + "\" where metadataId = :metadataId and accessionId in ( :accessionIds )", paramMap, new RowCallbackHandler() {
@Override @Override
public void processRow(ResultSet rs) throws SQLException { public void processRow(ResultSet rs) throws SQLException {
...@@ -216,8 +216,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository { ...@@ -216,8 +216,8 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
@Transactional @Transactional
private void delete(final Metadata metadata, final AccessionId accession, Method method) { private void delete(final Metadata metadata, final AccessionId accession, Method method) {
LOG.info("Deleting trait values in methodId={} for metadataId={} and accnId={}", method.getId(), metadata.getId(), accession.getId()); LOG.info("Deleting trait values in methodid={} for metadataid={} and accnid={}", method.getId(), metadata.getId(), accession.getId());
this.jdbcTemplate.update(String.format("DELETE FROM `%s` WHERE accessionId=? AND metadataId=?", method.getId()), new PreparedStatementSetter() { this.jdbcTemplate.update(String.format("DELETE FROM \"%s\" WHERE accessionid=? AND metadataid=?", method.getId()), new PreparedStatementSetter() {
@Override @Override
public void setValues(PreparedStatement pst) throws SQLException { public void setValues(PreparedStatement pst) throws SQLException {
pst.setLong(1, accession.getId()); pst.setLong(1, accession.getId());
...@@ -248,7 +248,7 @@ public class TraitValueRepositoryImpl implements TraitValueRepository { ...@@ -248,7 +248,7 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
} }
this.jdbcTemplate.batchUpdate( this.jdbcTemplate.batchUpdate(
String.format("INSERT INTO `%s` (accessionId, metadataId, `%s`) VALUES (?, ?, ?)", method.getId(), method.getFieldName()), String.format("INSERT INTO \"%s\" (accessionId, metadataId, \"%s\") VALUES (?, ?, ?)", method.getId(), method.getFieldName().toLowerCase()),
new BatchPreparedStatementSetter() { new BatchPreparedStatementSetter() {
@Override @Override
public void setValues(PreparedStatement pst, int idx) throws SQLException { public void setValues(PreparedStatement pst, int idx) throws SQLException {
...@@ -342,7 +342,7 @@ public class TraitValueRepositoryImpl implements TraitValueRepository { ...@@ -342,7 +342,7 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
* @return * @return
*/ */
private int countTraitAccessions(long methodId, long metadataId) { private int countTraitAccessions(long methodId, long metadataId) {
return this.jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM `%s` WHERE metadataId=?", methodId), Integer.class, metadataId); return this.jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM \"%s\" WHERE metadataId=?", methodId), Integer.class, metadataId);
} }
/** /**
...@@ -354,14 +354,14 @@ public class TraitValueRepositoryImpl implements TraitValueRepository { ...@@ -354,14 +354,14 @@ public class TraitValueRepositoryImpl implements TraitValueRepository {
* @return * @return
*/ */
private int countTraitValues(long methodId, long metadataId, long accessionId) { private int countTraitValues(long methodId, long metadataId, long accessionId) {
return this.jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM `%s` WHERE metadataId=? AND accessionId=?", methodId), Integer.class, return this.jdbcTemplate.queryForObject(String.format("SELECT COUNT(*) FROM \"%s\" WHERE metadataId=? AND accessionId=?", methodId), Integer.class,
metadataId, accessionId); metadataId, accessionId);
} }
@Override @Override
public Map<String, Long> getStatistics(Method method) { public Map<String, Long> getStatistics(Method method) {
final HashMap<String, Long> stats = new HashMap<String, Long>(); final HashMap<String, Long> stats = new HashMap<String, Long>();
this.jdbcTemplate.query(MessageFormat.format("SELECT `{0}`, COUNT(*) FROM `{1,number,#}` GROUP BY `{0}`", method.getFieldName(), method.getId()), this.jdbcTemplate.query(MessageFormat.format("SELECT \"{0}\", COUNT(*) FROM \"{1,number,#}\" GROUP BY \"{0}\"", method.getFieldName().toLowerCase(), method.getId()),
new RowCallbackHandler() { new RowCallbackHandler() {
@Override @Override
public void processRow(ResultSet rs) throws SQLException { public void processRow(ResultSet rs) throws SQLException {
......
...@@ -51,7 +51,7 @@ import org.springframework.validation.beanvalidation.MethodValidationPostProcess ...@@ -51,7 +51,7 @@ import org.springframework.validation.beanvalidation.MethodValidationPostProcess
@ComponentScan(basePackages= { "org.genesys2.server.security", "org.genesys2.server.service", "org.genesys2.server.component", "org.genesys2.brapi.service", "org.genesys.catalog.service" }) @ComponentScan(basePackages= { "org.genesys2.server.security", "org.genesys2.server.service", "org.genesys2.server.component", "org.genesys2.brapi.service", "org.genesys.catalog.service" })
@Import({ HazelcastConfig.class, CommonConfig.class, SchedulerConfig.class, DatabaseConfig.class, TemplatingConfig.class, MailConfig.class, OAuth2ServerConfig.class, SecurityConfig.class, CacheConfig.class, @Import({ HazelcastConfig.class, CommonConfig.class, SchedulerConfig.class, DatabaseConfig.class, TemplatingConfig.class, MailConfig.class, OAuth2ServerConfig.class, SecurityConfig.class, CacheConfig.class,
ElasticsearchConfig.class, FileRepositoryConfig.class, WebSecurityConfig.class, WebConfiguration.class, AuditConfig.class, GLISConfig.class, SwaggerConfig.class, AccessionListenersConfig.class }) ElasticsearchConfig.class, FileRepositoryConfig.class, WebSecurityConfig.class, WebConfiguration.class, AuditConfig.class, GLISConfig.class, SwaggerConfig.class, AccessionListenersConfig.class, ApplicationStartup.class })
@EnableAspectJAutoProxy @EnableAspectJAutoProxy
@EnableWebSecurity @EnableWebSecurity
......
package org.genesys2.spring.config;
import java.util.UUID;
import org.hibernate.dialect.PostgreSQL9Dialect;
import org.hibernate.metamodel.spi.TypeContributions;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.type.PostgresUUIDType;
public class CustomPostgreSQL9Dialect extends PostgreSQL9Dialect {
private final PostgresUUIDType postgresUUIDType = new PostgresUUIDType() {
private static final long serialVersionUID = 1L;
@Override
public String getName() {
return UUID.class.getName();
}
};
@Override
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
super.contributeTypes(typeContributions, serviceRegistry);
typeContributions.contributeType(postgresUUIDType);
}
}
...@@ -49,13 +49,13 @@ build.revision=${buildNumber} ...@@ -49,13 +49,13 @@ build.revision=${buildNumber}
# robots.txt # robots.txt
robots.allow=false robots.allow=false
db.url=jdbc:mysql://localhost/genesys?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false db.url=jdbc:postgresql://localhost:5432/genesys?stringtype=unspecified
db.driverClassName=com.mysql.jdbc.Driver db.driverClassName=org.postgresql.Driver
db.username=root hibernate.dialect=org.genesys2.spring.config.CustomPostgreSQL9Dialect
db.password= db.username=genesys
db.password=genesys
db.showSql=false db.showSql=false
db.hbm2ddl=false db.hbm2ddl=false
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
# bit.ly shortener # bit.ly shortener
# TODO change access token and guid # TODO change access token and guid
......
...@@ -8,6 +8,9 @@ hibernate.order_updates=true ...@@ -8,6 +8,9 @@ hibernate.order_updates=true
hibernate.order_inserts=true hibernate.order_inserts=true
hibernate.jdbc.batch_versioned_data=true hibernate.jdbc.batch_versioned_data=true
# Postgres
hibernate.jdbc.use_streams_for_binary=false
hibernate.cache.use_second_level_cache=true hibernate.cache.use_second_level_cache=true
hibernate.cache.use_query_cache=false hibernate.cache.use_query_cache=false
hibernate.cache.use_minimal_puts=true hibernate.cache.use_minimal_puts=true
......
...@@ -7,16 +7,18 @@ changeLogFile=src/main/resources/liquibase/liquibase-changeLog.yml ...@@ -7,16 +7,18 @@ changeLogFile=src/main/resources/liquibase/liquibase-changeLog.yml
#password= #password=
#driver=com.mysql.jdbc.Driver #driver=com.mysql.jdbc.Driver
# Uncomment for mvn liquibase:diff ## Uncomment for mvn liquibase:diff
diffChangeLogFile=src/main/resources/liquibase/liquibase-diff-changeLog.yml #verbose=true
## &hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy #logging=debug
# Existing database #diffChangeLogFile=src/main/resources/liquibase/liquibase-diff-changeLog.yml
url=jdbc:mysql://localhost/genesys20181126?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false ## Current database
username=root #url=jdbc:postgresql://localhost:5432/genesys?stringtype=unspecified
password= #username=mobreza
driver=com.mysql.jdbc.Driver #password=
# Upgraded database #driver=org.postgresql.Driver
referenceUrl=jdbc:mysql://localhost/genesys?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false ## Base database
referenceDriver=com.mysql.jdbc.Driver #referenceUrl=jdbc:postgresql://localhost:5432/genesys2?stringtype=unspecified
referenceUsername=root #referenceDriver=org.postgresql.Driver
referencePassword= #referenceUsername=mobreza
#referencePassword=
#