db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian McCallister <mccallis...@forthillcompany.com>
Subject Re: problem with ojbdoclet
Date Fri, 28 Nov 2003 22:34:25 GMT
Martin,

It is probably better to ask this on the ojb-users list =)

-Brian

On Friday, November 28, 2003, at 04:54 PM, Martin Kluge wrote:

> Hello,
>
> I am new to ojb and ojbdoclet and try to automate the building of  the
> the xml-files with ojbdoclet.
> The project_schema.xml and repository_user.xml files are generated,
> but dont contain the necessary information (are empty in principle).
> Any hint what could have gone wrong?
>
> Regards,
> Martin
>
>
>
> I run an ant-script as follows:
>
> ======>
> <project name="hpca-inventar" default="ojb-repository-files"
> basedir=".">    <description>Ant-Skript fuer die
> HPCA-Inventar-Applikation</description>
>
>     <!-- properties - definition - section -->
>     <property name="author" value="mk"/>
>     <property environment="env"/>
>     <property name="model-dir"  location="de/hpca/model"/>
>     <property name="ojb-dir" location="de/hpca/model/ojb"/>
>     <property name="ojb-lib-dir" location = "/opt/jutils/ojb/lib"/>
>     <!-- property file="/opt/jutils/ojb/build.properties"/ -->
>     <!-- property file="/opt/jutils/ojb/profile/mysql.profile"/ -->
> 	
> 	
> 	<!-- path - definition - section -->
> 	<path id="ojbdoclet-classpath">
>         <fileset dir="${ojb-lib-dir}">
>             <include name="**/*.jar"/>
>         </fileset>
>     </path>
> 	
> 	<target name="init">
> 		<description>initializes everything</description>
> 		<mkdir dir="${ojb-dir}"/>
> 	</target>
> 	
> 	<target name="ojb-repository-files" depends="init">
> 		 <description >use xdoclet to extract ojb-Information from
> classes</description>	     <taskdef name="ojbdoclet"
> classname="xdoclet.modules.ojb.OjbDocletTask"
> classpathref="ojbdoclet-classpath"/>        <ojbdoclet
> destdir="${ojb-dir}">            <fileset dir="${model-dir}">
>             	<filename name="**/Dienst*.java"/>
>             </fileset>
>             <ojbrepository destinationFile="repository_user.xml"/>
>             <torqueschema databaseName="hpca"
> destinationFile="project_schema.xml"/>        </ojbdoclet>
>     </target>
> 	
> </project>
> <======
>
> The ant console output:
>
> ======>
> ant -v
> Apache Ant version 1.5.4 compiled on August 12 2003
> Buildfile: build.xml
> Detected Java version: 1.4 in: /usr/lib/j2sdk1.4.2/jre
> Detected OS: Linux
> parsing buildfile build.xml with URI =
> file:/home/mk/workspace/hpca-inventar/build.xml Project base dir set
> to: /home/mk/workspace/hpca-inventar [property] Loading Environment
> env. Build sequence for target `ojb-repository-files' is [init,
> ojb-repository-files] Complete build sequence is [init,
> ojb-repository-files, main, init-db]
>
> init:
>
> ojb-repository-files:
> [ojbdoclet] (XDocletMain.start                   47  ) Running
> <ojbrepository/>[ojbdoclet] (XDocletMain.start                   47  )
> Running <torqueschema/>
>
> BUILD SUCCESSFUL
> Total time: 7 seconds
> <=======
>
> The generated files look as follows (they are basically empty):
>
> ==========>
> <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
> <!DOCTYPE database SYSTEM
> "http://jakarta.apache.org/turbine/dtd/database.dtd"><!-- Generated by
> the xdoclet-ojb module -->
>
> <database name="hpca">
>
> </database>
> <=========
>
> ==========>
> <!-- file containing the repository descriptions for user-defined
> types --><!-- Generated by the xdoclet-ojb module -->
> <==========
>
> The following file should be processed:
>
> =========>
> package de.hpca.model;
>
> /**
>  * @author mk
>  *
>  * @ojb.class table="DIENSTSTELLE"
>  *
>  *
>  */
> public class DienstStelle {
> 	
> 	/**
> 	  * @ojb.field column="ID"
> 	  *                autoincrement="true"
> 	  * 				primarykey="true"
> 	  */
> 	private int id;
> 	
> 	/**
> 	  * @ojb.field column="BEZEICHNUNG"
> 	  *                length="255"
> 	  */
> 	private String bezeichnung;
> 	
> 	/**
> 	  * @ojb.field column="KUERZEL"
> 	  *                length="10"
> 	  */
> 	private String kuerzel;
> 	
> 	public DienstStelle(){
> 			setKuerzel("-");
> 			setBezeichnung("-");
> 	}
> 	
> 	public DienstStelle(String kuerzel, String bezeichnung){
> 		setKuerzel(kuerzel);
> 		setBezeichnung(bezeichnung);
> 	}
>
> 	public void setBezeichnung(String bezeichnung) {
> 		this.bezeichnung = bezeichnung;
> 	}
>
> 	public String getBezeichnung() {
> 		return bezeichnung;
> 	}
>
> 	public void setKuerzel(String kuerzel) {
> 		this.kuerzel = kuerzel;
> 	}
>
> 	public String getKuerzel() {
> 		return kuerzel;
> 	}
>
> 	public void setId(int id) {
> 		this.id = id;
> 	}
>
> 	public int getId() {
> 		return id;
> 	}
>
> }
> <=================
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message