db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prescott R. Balch <presc...@prescottbalch.org>
Subject Re: addAscendingOrderBy problem
Date Mon, 16 Dec 2002 23:30:16 GMT

No problem.  Here's the schema.  I'm a pretty serious runner and I've
written a Java app that manages all my training data.  I started it
long ago with InstantDB but the thing fell apart with a bit of data in
it.  I switched to using Torque and MySQL and all was going well until
the 3.0 release and this problem.

<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE database SYSTEM "http://jakarta.apache.org/turbine/dtd/database.dtd">

<database>

  <table name="Constant">
    <column name="ConstantKey" required="true" 
            primaryKey="true" type="INTEGER"/>
    <column name="ConstantValue" required="true" size="255"
            type="VARCHAR"/>
  </table>
	    
  <table name="Course">
    <column name="CourseId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunnerId" required="true" type="INTEGER"/>
    <column name="CourseName" required="true" size="64" type="VARCHAR"/>
    <column name="CourseNotes" required="false" size="1024" type="VARCHAR"/>
    <column name="CourseCity" required="false" size="64" type="VARCHAR"/>
    <column name="CourseState" required="false" size="2" type="CHAR"/>
    <column name="CourseAccuracy" required="false" size="1" type="CHAR"/>
    <column name="CourseDefault" required="false" size="1" type="CHAR"/>

    <foreign-key foreignTable="Runner">
        <reference local="RunnerId" foreign="RunnerId"/>
    </foreign-key>
  </table>

  <table name="Runner">
    <column name="RunnerId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunnerName" required="true" size="64" type="VARCHAR"/>
    <column name="RunnerBirthday" required="false" type="DATE"/>
    <column name="RunnerGender" required="false" size="1" type="CHAR"/>
    <column name="RunnerHeight" required="false" type="FLOAT"/>
    <column name="RunnerSpecies" required="false" size="32" type="VARCHAR"/>
    <column name="RunnerDefault" required="false" size="1" type="CHAR"/>
    <column name="RunnerMetric" required="false" size="1" type="CHAR"/>
    <column name="RunnerEmailAddress" required="false" size="128"
                  type="VARCHAR"/>
    <column name="RunnerAutoEmail" required="false" size="1" type="CHAR"/>
    <column name="RunnerSmtpServer" required="false" size="128"
                  type="VARCHAR"/>
    <column name="RunnerSmtpUserid" required="false" size="128"
                  type="VARCHAR"/>
    <column name="RunnerSmtpPswd" required="false" size="128" type="VARCHAR"/>
    <column name="RunnerWeekStartDay" required="true" size="3"
                  type="CHAR"/>
    <column name="RunnerPassword" required="false" size="64" type="VARCHAR"/>
  </table>

  <table name="Run">
    <column name="RunId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunnerId" required="true" type="INTEGER"/>
    <column name="RunDate" required="true" type="DATE"/>
    <column name="RunTime" required="false" type="INTEGER"/>
    <column name="RunTemp" required="false" type="INTEGER"/>
    <column name="RunHumidity" required="false" type="INTEGER"/>
    <column name="CourseId" required="true" type="INTEGER"/>
    <column name="RunWindSpeed" required="false" type="INTEGER"/>
    <column name="RunWindDirection" required="false" size="4"
                  type="CHAR"/>
    <column name="ShoeId" required="true" type="INTEGER"/>
    <column name="RunTypeId" required="true" type="INTEGER"/>
    <column name="RunWeight" required="false" type="FLOAT"/>
    <column name="RunNotes" required="false" size="1024" type="VARCHAR"/>
    <column name="RunHR" required="false" type="FLOAT"/>
    <column name="RunMorningHR" required="false" type="FLOAT"/>
    <column name="RunSleepTime" required="false" type="FLOAT"/>
    <column name="RunSleepQuality" required="false" size="4"
            type="CHAR"/>
    <column name="RunInjuryNotes" required="false" size="1024" type="VARCHAR"/>
    <column name="RunWithWhom" required="false" size="32"
            type="VARCHAR"/>
    <column name="RunPerceivedExertion" required="false"
            type="INTEGER"/>
	
    <foreign-key foreignTable="Runner">
        <reference local="RunnerId" foreign="RunnerId"/>
    </foreign-key>

    <foreign-key foreignTable="RunType">
        <reference local="RunTypeId" foreign="RunTypeId"/>
    </foreign-key>

    <foreign-key foreignTable="Course">
        <reference local="CourseId" foreign="CourseId"/>
    </foreign-key>

    <foreign-key foreignTable="Shoe">
        <reference local="ShoeId" foreign="ShoeId"/>
    </foreign-key>
  </table>

  <table name="Lap">
    <column name="LapId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunId" required="true" type="INTEGER"/>
    <column name="LapNumber" required="true" type="INTEGER"/>
    <column name="RunnerId" required="true" type="INTEGER"/>
    <column name="LapDistance" required="true" type="FLOAT"/>
    <column name="LapTime" required="true" type="FLOAT"/>
    <column name="RunTypeId" required="true" type="INTEGER"/>
    <column name="LapHR" required="false" type="FLOAT"/>
    <column name="LapRecoveryTime" required="false" type="FLOAT"/>
    <column name="LapRecoveryDistance" required="false" type="FLOAT"/>
    <column name="LapRecoveryHR" required="false" type="FLOAT"/>
    <column name="LapNotes" required="false" size="1024" type="VARCHAR"/>

    <index name="idxLap0">
        <index-column name="RunId"/>
    </index>

    <foreign-key foreignTable="Run">
        <reference local="RunId" foreign="RunId"/>
    </foreign-key>
	
    <foreign-key foreignTable="Runner">
        <reference local="RunnerId" foreign="RunnerId"/>
    </foreign-key>

    <foreign-key foreignTable="RunType">
        <reference local="RunTypeId" foreign="RunTypeId"/>
    </foreign-key>
  </table>  

  <table name="Pr">
    <column name="PrId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunnerId" required="true" type="INTEGER"/>
    <column name="RunTypeId" required="true" type="INTEGER"/>
    <column name="RunId" required="false" type="INTEGER"/>
    <column name="PrDate" required="false" type="DATE"/>
    <column name="PrDistance" required="false" type="FLOAT"/>
    <column name="PrTime" required="false" type="FLOAT"/>
    <column name="PrNotes" required="false" size="1024" type="VARCHAR"/>
    <column name="CourseId" required="false" type="INTEGER"/>
		
    <index name="idxPr0">
        <index-column name="RunnerId"/>
    </index>

    <foreign-key foreignTable="Run">
        <reference local="RunId" foreign="RunId"/>
    </foreign-key>
	
    <foreign-key foreignTable="Runner">
        <reference local="RunnerId" foreign="RunnerId"/>
    </foreign-key>

    <foreign-key foreignTable="RunType">
        <reference local="RunTypeId" foreign="RunTypeId"/>
    </foreign-key>

    <foreign-key foreignTable="Course">
        <reference local="CourseId" foreign="CourseId"/>
    </foreign-key>
  </table>

  <table name="Rp">
    <column name="RpId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunnerId" required="true" type="INTEGER"/>
    <column name="RpEmailAddress" required="true" size="128"
                type="VARCHAR"/> 
    <column name="RpAutoEmail" required="false" size="1" type="CHAR"/>
		
    <foreign-key foreignTable="Runner">
        <reference local="RunnerId" foreign="RunnerId"/>
    </foreign-key>

  </table>

  <table name="RunType">
    <column name="RunTypeId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunnerId" required="true" type="INTEGER"/>
    <column name="RunType" required="true" size="16" type="VARCHAR"/>
    <column name="RunTypeDescription" required="false" size="1024" type="VARCHAR"/>
    <column name="RunTypeIsQuality" required="false" size="1"
            type="CHAR"/>
    <column name="RunTypeTrackPr" required="false" size="1"
            type="CHAR"/>
    <column name="RunDefault" required="false" size="1"
            type="CHAR"/>
    <column name="WorkoutTypeName" required="false" size="16" type="VARCHAR"/>
	
    <foreign-key foreignTable="Runner">
        <reference local="RunnerId" foreign="RunnerId"/>
    </foreign-key>
    <foreign-key foreignTable="WorkoutType">
        <reference local="WorkoutTypeName" foreign="WorkoutTypeName"/>
    </foreign-key>

  </table>

  <table name="Shoe">
    <column name="ShoeId" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="RunnerId" required="true" type="INTEGER"/>
    <column name="ShoeNickname" required="true" size="32" type="VARCHAR"/>
    <column name="ShoeDatePurchased" required="false" type="DATE"/>
    <column name="ShoeManufacturer" required="false" size="32"
            type="VARCHAR"/>
    <column name="ShoeModel" required="false" size="64"
            type="VARCHAR"/>
    <column name="ShoeModelYear" required="false" type="FLOAT"/>
    <column name="ShoeNotes" required="false" size="1024" type="VARCHAR"/>
    <column name="ShoeRetired" required="false" size="1"
            type="CHAR"/>
    <column name="ShoeDefault" required="false" size="1" type="CHAR"/>
	
    <foreign-key foreignTable="Runner">
        <reference local="RunnerId" foreign="RunnerId"/>
    </foreign-key>

  </table>

  <table name="WorkoutType">
    <column name="WorkoutTypeName" required="true" size="16" type="VARCHAR"
            primaryKey="true"/>
    <column name="WorkoutTypeDesc" required="false" size="512" type="VARCHAR"/>

  </table>

</database>  


> Wow! I'm stumped! I was unable to reproduce this in my app. Perhaps
> something specific to your app is causing this. Could you send your
> database schema? If you don't want to post it to the list, you can just
> send it to my email. I'll respect your confidentiality.
> 
> Eric
> 
> 
> > 2002-12-16 14:24:16,022 [AWT-EventQueue-0] ERROR
> > org.yarl.swing.RunHistoryFrame - Could not select runtypes:
> > org.apache.torque.TorqueException
> > java.lang.NullPointerException
> > 	at
> > org.apache.torque.util.BasePeer.createQueryString(BasePeer.java:1168)
> 
> -- 
> Eric Emminger
> eric@ericemminger.com
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> 

Mime
View raw message