Question to xml batch generator
Tomasz Dreßler <[email protected]> Fri, 23 Apr 2004 22:19:55 +0200
| Newsgroups | gmane.comp.lib.sql.sqlpp |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------060205060800020305090701
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi!
I enjoy using sqlpp 2.14, because it's so easy to use :)
<http://sourceforge.net/project/showfiles.php?group_id=88217&package_id=115840&release_id=232492>
I still have a question. How can I implement a compositional primary key
which
references a foreign key from an other table?
I send you a nant build script which I have made suitable for your example.
Thanks
Greetings
Tomek
### pseudo example
create table customer(
customerID INT NOT NULL,
customerName nvarchar(50),
PRIMARY KEY (customerID)
);
create table task(
customerID INT NOT NULL,
orderID INT NOT NULL,
PRIMARY KEY (customerID,orderID),
FOREIGN KEY (customerID)
REFERENCES customer (customerID),
);
--------------060205060800020305090701
Content-Type: text/xml;
name="nant.build"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nant.build"
<?xml version="1.0"?>
<project name="DAL" default="build" basedir=".">
<!-- Target to run when build failed -->
<property name="nant.onfailure" value="clean"/>
<property name="debug" value="true" />
<property name="lib.dir" value="../lib" />
<property name="dal.dir" value="Test" />
<property name="assembly.dir" value="." />
<property name="assembly.filename" value="Test" />
<property name="graphviz.dir" value="E:\Programme\ATT\Graphviz" />
<!-- sql specific -->
<property name="db.name" value="Test" />
<property name="osql.parameter" value=" -E -d ${db.name} -i" />
<property name="sql.dir" value="${dal.dir}\Data\Providers" />
<!-- execute SQL querys -->
<target name="sql">
<echo message="create Tables from: ${nant.project.basedir}\{sql.dir}\${db.name}db.sql" level="Info" />
<exec program="osql" workingdir="${sql.dir}" commandline="${osql.parameter} ${db.name}db.sql"/>
<foreach item="File" property="filename" >
<in>
<items>
<includes name="${sql.dir}\*.sql" />
<excludes name="${sql.dir}\${db.name}db.sql" />
</items>
</in>
<do>
<echo message="execute Stored procedures from: ${filename}" level="Info" />
<exec program="osql" workingdir="${sql.dir}" commandline="${osql.parameter} ${filename}"/>
</do>
</foreach>
</target>
<!-- output dbshema.png picture -->
<target name="graphviz" >
<exec program="${graphviz.dir}\bin\dot.exe"
commandline="-Tpng -o ${dal.dir}\dbshema.png ${dal.dir}\dbshema.dot"
failonerror="false" />
</target>
<!-- remove all generated files -->
<target name="clean">
<delete dir="${dal.dir}" failonerror="false"/>
<delete>
<fileset>
<includes name="${assembly.dir}/${assembly.filename}.*" failonerror="false"/>
</fileset>
</delete>
</target>
<!-- start generate DAL code-->
<target name="generateDAL" depends="clean">
<exec program="gen.bat" debug="${debug}" />
</target>
<!-- generate and place Assembly -->
<target name="build" depends="generateDAL, graphviz">
<csc target="library" output="${assembly.dir}/${assembly.filename}.dll" debug="${debug}">
<mkdir dir="${assembly.dir}" />
<references basedir="${lib.dir}" >
<includes name="Microsoft.ApplicationBlocks.Cache.dll" />
<includes name="Microsoft.ApplicationBlocks.Data.dll" />
<includes name="Microsoft.ApplicationBlocks.ExceptionManagement.dll" />
<includes name="Microsoft.ApplicationBlocks.ExceptionManagement.Interfaces.dll" />
<includes name="Microsoft.ApplicationBlocks.MemoryMappedFile.dll" />
<includes name="Microsoft.Web.Services.dll" />
<includes name="NCrypto.Security.Cryptography.dll" />
<includes name="NullableTypes.dll" />
</references>
<sources basedir="${dal.dir}">
<includes name="Config/DataProviderConfigurationHandler.cs" />
<includes name="Data/Providers/*.cs" />
<includes name="Data/*.cs" />
</sources>
</csc>
</target>
</project>
--------------060205060800020305090701--
-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297