1 17 package org.apache.ws.jaxme.pm.generator.jdbc; 18 19 import org.apache.ws.jaxme.generator.sg.ComplexTypeSG; 20 import org.apache.ws.jaxme.generator.sg.ComplexTypeSGChain; 21 import org.apache.ws.jaxme.generator.sg.impl.ComplexTypeSGChainImpl; 22 import org.apache.ws.jaxme.xs.XSType; 23 import org.apache.ws.jaxme.xs.impl.XSUtil; 24 import org.xml.sax.SAXException ; 25 26 29 public class JdbcComplexTypeSG extends ComplexTypeSGChainImpl { 30 private final JaxMeJdbcSG jdbcSG; 31 private XSType xsType; 32 33 protected JdbcComplexTypeSG(JaxMeJdbcSG pJdbcSG, ComplexTypeSGChain o, XSType pType) { 34 super(o); 35 jdbcSG = pJdbcSG; 36 if (pType == null) { 37 throw new NullPointerException ("The XSType argument must not be null."); 38 } 39 xsType = pType; 40 } 41 42 public void init(ComplexTypeSG pTypeSG) throws SAXException { 43 super.init(pTypeSG); 44 TableDetails tableDetails = (TableDetails) 45 XSUtil.getSingleAppinfo(xsType.getAnnotations(), TableDetails.class); 46 if (tableDetails != null) { 47 CustomTableData data = jdbcSG.addTableData(pTypeSG, xsType, tableDetails); 48 pTypeSG.getTypeSG().setProperty(jdbcSG.getKey(), data); 49 } 50 } 51 } 52 | Popular Tags |