1 9 package org.jboss.portal.setup.impl.dl.dbloader.hibernate; 10 11 import org.jboss.portal.setup.impl.dl.dbloader.SqlFunctionMetaData; 12 import org.jboss.portal.setup.PortalSetupException; 13 import org.hibernate.dialect.Dialect; 14 15 16 17 import java.sql.Date ; 18 19 25 public class HibernateSqlFunctionmetaData extends SqlFunctionMetaData 26 { 27 HibernateSqlFunctionmetaData(String funcStr) 28 { 29 super(funcStr); 30 } 31 32 public Object resolveSQLFunction(Dialect dbVendor) throws PortalSetupException 33 { 34 if ("now".equalsIgnoreCase(getFuncName())) 35 { 36 return new Date (System.currentTimeMillis()); 37 } 38 else 39 { 40 throw new PortalSetupException("Specified function: " + 41 (getFuncName() + " is not supported by hibernate dialect: " + 42 dbVendor)); 43 } 44 } 45 } 46 | Popular Tags |