From: Steve E. (JIRA) <no...@at...> - 2005-11-21 16:25:04
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1083?page=comments#action_20862 ] Steve Ebersole commented on HHH-1083: ------------------------------------- We should definitely restrict this to tables and indexes (oracle, for example, allows storage clause options for BLOB/CLOB columns seperate from that of the rest of the table). There are two ways I can see this implemented: 1) via metadata 2) via a registered "customizer" For #2, I would envision a simple interface where users could register an implementation which would define additional information to append to the CREATE xxx DDL operation. For #1, I would see something like: <class name="..." table="my_table"> <create-options> <option table="my_table">my specific option clause</option> <option index="...">...</option> </create-options> </class> I would prefer #2. public interface DDLCustomizer { void setDefaultSchema(String schema); void setDefaultCatalog(String catalog); String getTableCreationOptions(String tableName, String schema, String catalog, Dialect dialect); String getIndexCreationOptions(String indexName, String tableName, String[] columnNames, String schema, String catalog, Dialect dialect); } Or maybe even just: public interface DDLCustomizer { void setDefaultSchema(String schema); void setDefaultCatalog(String catalog); String getTableCreationOptions(Table table, Dialect dialect); String getIndexCreationOptions(Index index, Dialect dialect); } > Customization of CREATE TABLE with storage clause etc. > ------------------------------------------------------ > > Key: HHH-1083 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1083 > Project: Hibernate3 > Type: New Feature > Reporter: Christian Bauer > Priority: Minor > Fix For: 3.1 > > > Currently Hibernate features a hotfix for the MySQLInnoDBDialect: > public String getTableTypeString() { > return " type=InnoDB"; > } > However, this is not the only appendix that is useful for CREATE TABLE. We should do several things: > - allow appendix for CREATE INDEX, for example, to define the tablespace > - pass in additional arguments to getTableTypeString(), such as tableName, schemaName, catalogName - for example, to allow custom Dialects to return different tablespaces for particular tables > - probably rename the getTableTypeString() method to getTableAppendixString() and getIndexAppendixString() -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |