Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[dtp-dev] Generating DDL from SQL Model

Hi Guys,

I have been trying to generate DDL with this simple code but I keep
hitting a brick wall, any help would be appreciated:

SQLSchemaFactory sqlSchemaFactory = SQLSchemaFactory.eINSTANCE;

Schema mySchema = sqlSchemaFactory.createSchema(); Table myTable =
SQLTablesFactory.eINSTANCE.createPersistentTable() ;
myTable.setName("MyTable"); Column column =
SQLTablesFactory.eINSTANCE.createColumn();

//set DataType
DataType dataType =
SQLDataTypesFactory.eINSTANCE.createBinaryStringDataType();
column.setDataType(dataType);
myTable.getColumns().add(column);
mySchema.getTables().add(myTable);


//pass schema to DDLGen
GenericDdlGenerator gdg = new GenericDdlGenerator(); String[] test =
gdg.generateDDL(new SQLObject[]{(SQLObject)mySchema}, new
NullProgressMonitor()); System.out.println(test);

I have been told not to instantiate the GenericDdlGenerator in this
manner, how else would do this?

Many thanks,
Alex 
 
-- 
 
This message and any attachments are confidential, proprietary, and may be privileged.  If this message was misdirected, Barclays Global Investors (BGI) does not waive any confidentiality or privilege.  If you are not the intended recipient, please notify us immediately and destroy the message without disclosing its contents to anyone.  Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized.  The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of BGI, unless the author is authorized by BGI to express such views or opinions on its behalf.  All email sent to or from this address is subject to electronic storage and review by BGI.  Although BGI operates anti-virus programs, it does not accept responsibility for any damage whatsoever caused by viruses being passed. 
 
-- 
 
Barclays Global Investors Limited is authorized and regulated by The Financial Services Authority. Registered in England. Registered No:796793. Registered Office: 1 Churchill Place, London E14 5HP.


Back to the top