Oh!  Silly me - I misunderstood.  Yes, there is a onetomany pointing
to UserContent in my QuizResult object, like so:

  <object name="QuizResult" table="quizResult">
    <id name="quizResultId" type="numeric"/>
    <property name="quizId" type="numeric" />
    <property name="userId" type="numeric" />
    <property name="totalCorrect" type="numeric" />
    <property name="totalQuestion" type="numeric" />
    <property name="lessonId" type="numeric" />
    <property name="dateModified" type="date" />
    <manytoone name="message">
      <link to="userContent.UserContent" column="userContentId" />
    </manytoone>
    <onetomany name="incorrectAnswers">
      <link to="answer.Answer" column="answerId" />
      <collection type="array">
        <order property="answerId" order="asc" />
      </collection>
    </onetomany>
    <onetomany name="hints">
      <link to="userContent.UserContent" column="userContentId" />
      <collection type="array">
        <order property="userContentId" order="asc" />
      </collection>
    </onetomany>
  </object>

The idea here is that one QuizResult can have many incorrect answers,
and can thus also have many hints, each of which are represented by a
piece of UserContent.


On Dec 18, 8:54 pm, "Mark Mandel" <[email protected]> wrote:
> No, I mean, is there a onetomany that points to your object UserContent?
>
> Mark
>
> On Fri, Dec 19, 2008 at 12:49 PM, Brian FitzGerald
>
>
>
> <[email protected]> wrote:
>
> > I would give it a onetomany a go but it really seems like manytoone is
> > the right fit.  For example, an answer will only ever reference one
> > piece of userContent, and the userContent will never care about the
> > answer .... seems like a manytoone.  Whereas a question will always
> > have many answers, seems like a onetomany (which is how it's defined
> > and working well).  I mean, I could rename the columns to have the
> > foreign keys not be named the same as the id in the userContent
> > object.  Such as, "lnkUserContentId", but I'm thinking that wouldn't
> > solve the problem anyway since I am having the same problem with
> > textualLessonId, which is clearly not named the same as the primary
> > key in the userContent.UserContent object (userContentId).
>
> > Does it seem like I'm doing something wrong in Transfer with how
> > things are currently configured?
>
> > Thanks again for your insight,
> > Brian
>
> > On Dec 18, 5:45 pm, "Mark Mandel" <[email protected]> wrote:
> >> What about onetomany?
>
> >> On Fri, Dec 19, 2008 at 9:15 AM, Brian FitzGerald
>
> >> <[email protected]> wrote:
>
> >> > Hey Mark,
>
> >> > Thank you for your response.  You're correct, there many objects are
> >> > referencing "userContentId" in a manytoone relationship with the
> >> > UserContent object.  Some have their foreign key named userContentId,
> >> > and some do not.  But that shouldn't be a problem, should it?  For
> >> > example, here's how the Answer object looks:
>
> >> >  <object name="Answer" table="answer">
> >> >    <id name="answerId" type="numeric"/>
> >> >    <property name="isCorrectAnswer" type="boolean"/>
> >> >    <property name="position" type="numeric"/>
> >> >    <manytoone name="userContent">
> >> >      <link to="userContent.UserContent" column="userContentId" />
> >> >    </manytoone>
> >> >  </object>
>
> >> > Hmm.... or maybe that is a problem ?
>
> >> > On Dec 18, 3:44 pm, "Mark Mandel" <[email protected]> wrote:
> >> >> What places do you have 'userContentId' defined, there must be more
> >> >> than what you are showing.
>
> >> >> Is it possible you write a onetomany that points to the UserContent
> >> >> object, with a FK of userContentId ?
>
> >> >> Do a search of your config for 'userContentId', and see if you can
> >> >> find all the places where it exists.
>
> >> >> Mark
>
> >> >> On Fri, Dec 19, 2008 at 6:19 AM, Brian FitzGerald
>
> >> >> <[email protected]> wrote:
>
> >> >> > Hey all, I've been working fine w/ onetomany,manytomany, and manytoone
> >> >> > throughout this application, but for some reason I can't figure out
> >> >> > this one issue.  I am sure I am making a basic error, and would be
> >> >> > most grateful if someone could point me in the right direction.  I am
> >> >> > receiving the following db error:
>
> >> >> > "Column 'userContentId' cannot be null"
>
> >> >> > I've stripped down the following code to just what's relevant.  My
> >> >> > "Lesson" definition has a manytoone link with the userContent
> >> >> > table .... which stores the actual textual content for the lesson in
> >> >> > multiple languages.  The foreign key in the lesson table is
> >> >> > textualLessonId
>
> >> >> >  <object name="Lesson" table="lesson">
> >> >> >    <id name="lessonId" type="numeric"/>
> >> >> >    <manytoone name="textualLesson">
> >> >> >      <link to="userContent.UserContent" column="textualLessonId" />
> >> >> >    </manytoone>
> >> >> >  </object>
>
> >> >> >  <object name="UserContent" table="userContent">
> >> >> >    <id name="userContentId" type="numeric" />
> >> >> >    <property name="textEng" type="string" />
> >> >> >    <property name="textSpa" type="string" />
> >> >> >    <property name="longTextEng" type="string" />
> >> >> >    <property name="longTextSpa" type="string" />
> >> >> >    <property name="audioEng" type="string" />
> >> >> >    <property name="audioSpa" type="string" />
> >> >> >    <property name="image" type="string" />
> >> >> >    <property name="difficulty" type="numeric" />
> >> >> >    <manytoone name="audioUser" lazy="true">
> >> >> >      <link to="user.User" column="audioUserId" />
> >> >> >    </manytoone>
> >> >> >  </object>
>
> >> >> > For some reason, the generated SQL is including a null 'userContentId'
> >> >> > in the update statement.  It really shouldn't be in the update
> >> >> > statement at all.
>
> >> >> > UPDATE      userContent
>
> >> >> > SET             textEng = 'Textual lesson for Greetings',
> >> >> >                   textSpa = 'Lección textual para Saludos',
> >> >> >                   longTextEng = 'my long text in eng',
> >> >> >                   longTextSpa = '',
> >> >> >                   audioEng =  '',
> >> >> >                   audioSpa =  '',
> >> >> >                   image = '',
> >> >> >                   difficulty = '0.0',
> >> >> >                   audioUserId = '46.0',
> >> >> >                   userContentId = 'null'   < -----------   problem
>
> >> >> > WHERE       userContentId = '277'
>
> >> >> > Does anyone have any idea why the userContentId is being placed in the
> >> >> > set portion of the update statement?  Thanks a ton for any
> >> >> > suggestions.
>
> >> >> > Brian
>
> >> >> --
> >> >> E: [email protected]
> >> >> W:www.compoundtheory.com
>
> >> --
> >> E: [email protected]
> >> W:www.compoundtheory.com
>
> --
> E: [email protected]
> W:www.compoundtheory.com
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to