Project

General

Profile

« Previous | Next » 

Revision c5c65993

Added by Andreas Müller over 15 years ago

View differences:

.gitattributes
434 434
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/reference/IReferenceDao.java -text
435 435
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/taxon/ITaxonDao.java -text
436 436
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/fetch/CdmFetch.java -text
437
cdmlib-persistence/src/main/java/org/hibernate/dialect/MySQL5InnoDBUtf8Dialect.java -text
438
cdmlib-persistence/src/main/java/org/hibernate/dialect/MySQL5MyISAMUtf8Dialect.java -text
437 439
cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/cdm.datasources.xml -text
438 440
cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/h2-datasource.xml -text
439 441
cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hsql-datasource.xml -text
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/types/MySQLDatabaseType.java
32 32
    
33 33
    
34 34
    //hibernate dialect
35
    private String hibernateDialect = "MySQLDialect";
36

  
35
    //private String hibernateDialect = "MySQLInnoDBUtf8Dialect";
36
    private String hibernateDialect = "MySQL5MyISAMUtf8Dialect";
37 37
    
38 38
    //connection String
39 39
	public String getConnectionString(ICdmDataSource ds, int port){
40
        return urlString + ds.getServer() + ":" + port + "/" + ds.getDatabase() + "?useUnicode=true&characterEncoding=utf8&connectionCollation=utf8_general_ci&characterSetResults=utf8&jdbcCompliantTruncation=false";
40
        return urlString + ds.getServer() + ":" + port + "/" + ds.getDatabase() + "?useUnicode=true&characterEncoding=utf8";
41
        //return urlString + ds.getServer() + ":" + port + "/" + ds.getDatabase() + "?useUnicode=true&characterEncoding=utf8&connectionCollation=utf8_general_ci&characterSetResults=utf8&jdbcCompliantTruncation=false";
41 42
    }  
42 43
    
43 44
    public MySQLDatabaseType() {
44 45
    	init (typeName, classString, urlString, defaultPort,  hibernateDialect );
45 46
	}
46 47

  
47

  
48

  
49

  
50 48
}
cdmlib-persistence/src/main/java/org/hibernate/dialect/MySQL5InnoDBUtf8Dialect.java
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

  
10
package org.hibernate.dialect;
11

  
12
import org.hibernate.dialect.MySQL5InnoDBDialect;
13

  
14
/**
15
 *  Extends MySQL5InnoDBDialect and sets the default charset to be UTF-8
16
 *	@author a.mueller
17
 *  /TODO licence
18
 */
19
public class MySQL5InnoDBUtf8Dialect extends MySQL5InnoDBDialect {
20

  
21
    public String getTableTypeString() {
22
        return " ENGINE=InnoDB DEFAULT CHARSET=utf8";
23
    }
24
    
25
}
cdmlib-persistence/src/main/java/org/hibernate/dialect/MySQL5MyISAMUtf8Dialect.java
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

  
10
package org.hibernate.dialect;
11

  
12

  
13

  
14
/**
15
 *  Extends MySQL5InnoDBDialect and sets the default charset to be UTF-8
16
 *	@author a.mueller
17
 *  /TODO licence
18
 */
19
public class MySQL5MyISAMUtf8Dialect extends MySQL5Dialect {
20

  
21
    public String getTableTypeString() {
22
        return " ENGINE=MYISAM DEFAULT CHARSET=utf8";
23
    }
24
    
25
    
26
	// compare org.hibernate.dialect.MySQLMyISAMDialect
27
    /* (non-Javadoc)
28
	 * @see org.hibernate.dialect.Dialect#dropConstraints()
29
	 */
30
	public boolean dropConstraints() {
31
		return false;
32
	}
33
	
34
}

Also available in: Unified diff