Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #2737

Re: ORM or JDBC?

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: ORM or JDBC?
References (10 earlier) <in0h9u$i5i$4@lust.ihug.co.nz> <IX7lp.805$YL5.263@newsfe05.iad> <in3558$2ts$4@lust.ihug.co.nz> <gZslp.3268$0s5.1254@newsfe17.iad> <in62jj$odq$7@lust.ihug.co.nz>
Message-ID <ZwElp.2499$tC3.465@newsfe01.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2011-04-02 09:21 -0300

Show all headers | View raw


On 11-04-01 11:45 PM, Lawrence D'Oliveiro wrote:
> In message <gZslp.3268$0s5.1254@newsfe17.iad>, Arved Sandstrom wrote:
> 
>> On 11-03-31 09:10 PM, Lawrence D'Oliveiro wrote:
>>
>>> In message <IX7lp.805$YL5.263@newsfe05.iad>, Arved Sandstrom wrote:
>>>
>>>> And by the way, if you can't define a relation without using the term
>>>> "normalization" then you're missing the point.
>>>
>>> Maybe you’ve been befogged by SQL, to the point where you don’t notice
>>> the mathematics underneath.
>>
>> I'm reasonably familiar with the mathematics of tuples and relations. I
>> also know that when I'm using a typical RDBMS and SQL that I'm not
>> constrained to a relational representation of my data.
> 
> How else do you express relationships?

That's not exactly what I was getting at, relationships, although I'll
touch on that. Assuming however that I am using a relational model for
my data (e.g. I have relation Person, relation Address, and relation
LifeEvent, say), the 1:N relationship that I have between relation
Person and relation LifeEvent I can describe by having a foreign key
column in LifeEvent, the domain of which is the primary keys of Person;
obviously a query that exploits that relationship also returns relations.

This is all relationships in a relational data model, though. If I am
not even using relations to describe my entities, why would you expect
relationships to be described in a relational manner?

Back to my original point: common RDBMSs aren't completely relational.
We can have duplicate rows in tables (this includes relations returned
by queries), and you can't have duplicate tuples in relations. This
whole business with DISTINCT is a patch...and can also be a code smell
since it may be hiding errors. Also, NULL isn't quite kosher - it's an
SQL afterthought. In that relationship I concocted above, I can have a
foreign key, potentially, on a row of LifeEvent which is NULL...that is,
it points to no Person. I can constrain that foreign key to be NOT NULL
but I shouldn't be allowed to make values NULL in the first place. The
use of NULLs in general mean that you've got poorly structured data.
Coupled with what you can do with SQL it can/will often lead to yet more
errors.

AHS
-- 
That's not the recollection that I recall...All this information is
certainly in the hands of the auditor and we certainly await his report
to indicate what he deems has occurred.
-- Halifax, Nova Scotia mayor Peter Kelly, who is currently deeply in
the shit

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: ORM or JDBC? Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-03-31 13:19 +1300
  Re: ORM or JDBC? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-03-31 20:16 -0300
    Re: ORM or JDBC? Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-01 13:10 +1300
      Re: ORM or JDBC? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-04-01 20:12 -0300
        Re: ORM or JDBC? Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-02 15:45 +1300
          Re: ORM or JDBC? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-04-02 09:21 -0300
    Re: ORM or JDBC? Tom Anderson <twic@urchin.earth.li> - 2011-04-01 22:38 +0100
      Re: ORM or JDBC? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-04-01 20:03 -0300
        Re: ORM or JDBC? Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-04-02 15:44 +1300
          Re: ORM or JDBC? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-04-02 09:35 -0300
            Re: ORM or JDBC? Lew <noone@lewscanon.com> - 2011-04-02 10:25 -0400

csiph-web