1 9 package org.jboss.portal.setup.impl.dl.dbloader.hibernate; 10 11 12 import org.jboss.portal.setup.impl.dl.dbloader.ColumnMetaData; 13 import org.jboss.portal.setup.impl.dl.dbloader.DbStatementMetaData; 14 import org.jboss.portal.setup.impl.dl.dbloader.ValueRowMetaData; 15 import org.jboss.portal.setup.PortalSetupException; 16 import org.jboss.portal.common.util.XML; 17 import org.w3c.dom.Element ; 18 19 20 import java.awt.*; 21 import java.util.*; 22 23 29 public class HibernateStatementMetaData extends DbStatementMetaData 30 { 31 HibernateStatementMetaData(Element config) throws PortalSetupException 32 { 33 super(config); 34 } 35 36 40 protected ColumnMetaData buildColumnMetaData(Element column) 41 { 42 Element name = XML.getUniqueChild(column, "name", true); 43 Element size = XML.getUniqueChild(column, "size", false); 44 Element javaType = XML.getUniqueChild(column, "type", true); 45 ColumnMetaData md = new HibernateColumnMetaData(XML.asString(name), 46 XML.asString(javaType) 47 , null == size ? -1 : Integer.parseInt(XML.asString(size))); 48 return md; 49 } 50 51 protected ValueRowMetaData buildValueRowMetaData(Element row) throws PortalSetupException 52 { 53 String values = XML.asString(row); 54 ValueRowMetaData vrmd = new ValueRowMetaData(values, getColumns()); 55 return vrmd; 56 } 57 } 58 | Popular Tags |