[hibernate-issues] [Hibernate-JIRA] Created: (HHH-7324) Add support for SERIAL columns in SapDB (MaxDB) dialect

Adam Dyga (JIRA) noreply at atlassian.com
Thu May 17 08:17:10 EDT 2012


Add support for SERIAL columns in SapDB (MaxDB) dialect
-------------------------------------------------------

                 Key: HHH-7324
                 URL: https://hibernate.onjira.com/browse/HHH-7324
             Project: Hibernate ORM
          Issue Type: Improvement
          Components: core
    Affects Versions: 3.6.10
            Reporter: Adam Dyga
            Priority: Minor


Currently org.hibernate.dialect.SAPDBDialect doesn't support SERIAL columns. The code below shows how how to do it by subclassing SAPDBDialect but it could be included in SAPDBDialect directly...


{code}
/**
 * Extends SAPDBDialect to support identity (serial) columns in MaxDB. 
 * 
 * @author Adam Dyga
 *
 */
public class MaxDBDialect extends SAPDBDialect {

	/**
	 * 
	 */
	public MaxDBDialect() {		
	}

	@Override
	public String getIdentitySelectString(String table, String column, int type) throws MappingException {
		return "select " + table + ".currval from dual";
	}

	@Override
	public boolean supportsIdentityColumns() {
		return true;
	}

	@Override
	public boolean hasDataTypeInIdentityColumn() {
		return true;
	}

	@Override
	public String getIdentityColumnString(int type) throws MappingException {
		return "serial";
	}	
	

}
{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list