Re: Problem with SDataLoader

[email protected] Sun, 17 Jan 2010 14:00:24 +1000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
PS.  The source code to SimpleOrm really is quite simple.  So if you have the source attached to your IDE, and then look inside, you will quickly see that it just picks out the first parameters as the primary keys.  (Not the best bit of code, the DataLoader is mainly an axillary debug tool.)

Anthony

At 01:56 PM 17/01/2010, [email protected] wrote:
>Hello Guenter,
>
>That is actually the documented behavior:-
>
>/**
> * Inserts (or updates) one record in the databases, and returns it. The
> * first element(s) in <code>record</code> contain the primary key
> * field(s), the rest contain the public
> */        
>  
>You could well argue that the documented behavior is wrong, but it is not wrong enough to change and so break compatibility.  Not having key fields first is very unusual.
>
>Just change your code to
>
>  dl.insertRecord(new Object[]{"val_A" ,new Integer(val_C), new Integer(val_D), new Integer(val_B)})
>
>Thanks for pointing this out.
>
>Anthony
>
>At 01:45 AM 16/01/2010, Guenter Wildmann wrote:
>>  
>>
>>Hello!
>>
>>I think there is a problem in SDataLoader.
>>
>>I have one table that looks like:
>>A (String, PK, FK)
>>B (Integer)
>>C (Integer, PK)
>>D (Integer, PK)
>>
>>(This is a given design, i have to access it but cannot change the order
>>of the attributes.)
>>
>>If i add a record via SDataLoader
>>
>>dl.insertRecord(new Object[]{"val_A",new Integer(val_B),new
>>Integer(val_C),new Integer(val_D)})
>>
>>i get a record (val_A, val_B, val_B, val_C).
>>The log shows a findOrCreate call (val_A, val_B, val_C).
>>
>>Ciao, Guenter
>>
>>
>
>Dr Anthony Berglas, [email protected]       Mobile: +61 4 4838 8874
>Just because it is possible to push twigs along the ground with ones nose
>does not necessarily mean that is the best way to collect firewood.

Dr Anthony Berglas, [email protected]       Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that is the best way to collect firewood.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/