/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved.
 * <a>http://www.crunii.com</a>
 */
package com.crunii.micro.domain.common.hibernate;

import org.hibernate.dialect.MySQL57Dialect;

/**
 * @author 田平 create 2013-6-4上午11:07:36
 *
 */
public class MySQLDialect extends MySQL57Dialect {
	
	
	public String getCreateSequenceString(String sequenceName) {
		return "insert into sequence values('"+sequenceName+"',"+"10000,1)";
	}
	public String getDropSequenceString(String sequenceName) {
		return "delete from sequence where name='"+sequenceName+"'";
	}

	public String getSequenceNextValString(String sequenceName) {
		return "select " + getSelectSequenceNextValString( sequenceName );
	}

	public String getSelectSequenceNextValString(String sequenceName) {
		return "nextval('"+sequenceName+"')";
	}

	public boolean supportsSequences() {
		return true;
	}

	public boolean supportsPooledSequences() {
		return false;
	}

	public String getQuerySequencesString() {
		return "select name from sequence";
	}

}
