OJB Books In The Works?

2003-08-02 Thread Michael Duffy
I see that there's a Hibernate book from Manning in
review:

http://www.theserverside.com/resources/HibernateReview.jsp

Are there any OJB books in the works?  I know I'd like
to see one.

I've been away from this list for a while, so please
excuse me if the topic has already been thrashed
within an inch of its life.  Thanks - MOD



__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: regression test errors

2003-04-01 Thread Michael Duffy

I should have thought of that - thanks.  MOD


--- Mahler Thomas <[EMAIL PROTECTED]> wrote:
> Here is some food for thought:
> http://db.apache.org/ojb/links.html
> 
> ;-)
> Thomas
> 
> > -Original Message-
> > From: Michael Duffy [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, April 01, 2003 6:30 PM
> > To: OJB Users List; [EMAIL PROTECTED]
> > Subject: Re: regression test errors
> > 
> > 
> > 
> > Thank you, Thomas, I think I'll take your advice
> and
> > stick with PB API.  For some reason, I thought you
> > intended it as a lower layer API, with ODMG to be
> > preferred.
> > 
> > Later in this thread both you and Bonnie referred
> to
> > "all the usual suspects" for O/R mapping papers. 
> I've
> > got copies of Scott Ambler's papers and one by
> > Wolfgang Keller that is quite good.  I've yet to
> score
> > a copy of Fowler's architecture patterns book. 
> What
> > else would you recommend that someone read?  What
> are
> > the papers "everyone knows" in this area?  Thanks
> in
> > advance for the education. - MOD
> > 
> > 
> > --- Thomas Mahler <[EMAIL PROTECTED]> wrote:
> > > Hi again Michael,
> > > 
> > > Michael Duffy wrote:
> > > > Thanks to both Thomas and Armin for their
> replies
> > > on
> > > > this thread.
> > > > 
> > > > Speaking for myself, I'm nervous about using
> OJB
> > > on my
> > > > current project, too, but I don't think the
> source
> > > is
> > > > entirely OJB.  A big part of it is fear of
> what I
> > > > DON'T know.  I very much liked the idea of
> using a
> > > > tool, developed by folks more expert than me. 
> I
> > > know
> > > > enought about JDBC to be able to do CRUD
> > > operations
> > > > and simple transactions, but the idea of
> having a
> > > > layer to abstract all that out of business
> objects
> > > was
> > > > appealing.
> > > > 
> > > > I heard Martin Fowler talk a few months ago. 
> He
> > > > mentioned using JAXOR as an O/R mapping tool. 
> > > When I
> > > > looked into it, I found NO documentation
> > > whatsoever.  
> > > > 
> > > > Google quickly turned up OJB as an
> alternative.  I
> > > > liked it right away, because it had more
> > > documentation
> > > > than JAXOR, it the cachet of being a Jakarta
> > > project,
> > > > and the stuff that I did actually worked.  Now
> > > I've
> > > > got a tree of four tables linked with m:n
> > > > associations, all working in JUnit tests.  
> > > > 
> > > > All that's well and good, but now I'm nervous
> > > about
> > > > that learning curve and what I'm ignorant of. 
> > > I've
> > > > done everything with the PersistenceBroker API
> > > because
> > > > it was easy to follow in the docs.  But now
> I'm
> > > > thinking that I should really be doing all of
> this
> > > > using ODMG API instead.  More learning, with a
> > > > deadline approaching.
> > > 
> > > choosing the actual OJB API is an important
> > > decision.
> > > 
> > > Why do you think you should use ODMG ? Do you
> really
> > > need Object level 
> > > transactions?
> > > 
> > > If you plan to build your own persistence
> Manager
> > > layer with Data Access 
> > > Objects (DAO) (and possibly DTOs) you could be
> > > better of with the PB API.
> > > 
> > > The PB API gives you maximum flexibility and
> nicely
> > > fits into J2EE based 
> > > programming models.
> > > 
> > > The ODMG API  specification was designed as a
> > > two-tier rich client API.
> > > 
> > > 
> > > > 
> > > > Here's a fundamental question:
> > > > 
> > > > RDBMS developers have put a lot of effort into
> > > > maintaining referential integrity, managing
> > > > transactions, etc.  It seems to me that OJB is
> > > taking
> > > > over a lot of that stuff.  When I created my
> > > tables, I
> > > > didn't add foreign key constraints.  I left
> all
> > > that
> > > > to OJB.  The ODMG API will

Re: regression test errors

2003-04-01 Thread Michael Duffy

Thank you, Thomas, I think I'll take your advice and
stick with PB API.  For some reason, I thought you
intended it as a lower layer API, with ODMG to be
preferred.

Later in this thread both you and Bonnie referred to
"all the usual suspects" for O/R mapping papers.  I've
got copies of Scott Ambler's papers and one by
Wolfgang Keller that is quite good.  I've yet to score
a copy of Fowler's architecture patterns book.  What
else would you recommend that someone read?  What are
the papers "everyone knows" in this area?  Thanks in
advance for the education. - MOD


--- Thomas Mahler <[EMAIL PROTECTED]> wrote:
> Hi again Michael,
> 
> Michael Duffy wrote:
> > Thanks to both Thomas and Armin for their replies
> on
> > this thread.
> > 
> > Speaking for myself, I'm nervous about using OJB
> on my
> > current project, too, but I don't think the source
> is
> > entirely OJB.  A big part of it is fear of what I
> > DON'T know.  I very much liked the idea of using a
> > tool, developed by folks more expert than me.  I
> know
> > enought about JDBC to be able to do CRUD
> operations
> > and simple transactions, but the idea of having a
> > layer to abstract all that out of business objects
> was
> > appealing.
> > 
> > I heard Martin Fowler talk a few months ago.  He
> > mentioned using JAXOR as an O/R mapping tool. 
> When I
> > looked into it, I found NO documentation
> whatsoever.  
> > 
> > Google quickly turned up OJB as an alternative.  I
> > liked it right away, because it had more
> documentation
> > than JAXOR, it the cachet of being a Jakarta
> project,
> > and the stuff that I did actually worked.  Now
> I've
> > got a tree of four tables linked with m:n
> > associations, all working in JUnit tests.  
> > 
> > All that's well and good, but now I'm nervous
> about
> > that learning curve and what I'm ignorant of. 
> I've
> > done everything with the PersistenceBroker API
> because
> > it was easy to follow in the docs.  But now I'm
> > thinking that I should really be doing all of this
> > using ODMG API instead.  More learning, with a
> > deadline approaching.
> 
> choosing the actual OJB API is an important
> decision.
> 
> Why do you think you should use ODMG ? Do you really
> need Object level 
> transactions?
> 
> If you plan to build your own persistence Manager
> layer with Data Access 
> Objects (DAO) (and possibly DTOs) you could be
> better of with the PB API.
> 
> The PB API gives you maximum flexibility and nicely
> fits into J2EE based 
> programming models.
> 
> The ODMG API  specification was designed as a
> two-tier rich client API.
> 
> 
> > 
> > Here's a fundamental question:
> > 
> > RDBMS developers have put a lot of effort into
> > maintaining referential integrity, managing
> > transactions, etc.  It seems to me that OJB is
> taking
> > over a lot of that stuff.  When I created my
> tables, I
> > didn't add foreign key constraints.  I left all
> that
> > to OJB.  The ODMG API will handle true
> transactions
> > and object/row locking.
> 
> The OJB/ODMG does have pessimistic object level
> locking. But it does not 
> provide DB row level locking!
> 
> > 
> > But what if OJB isn't the only path into the
> database?
> >  A DBA might balk at leaving all those things that
> the
> > RDBMS would handle to OJB.  Is it possible still
> leave
> > foreign key constraints in the database so others
> > could use them without OJB?
> 
> Yes! It's generally a good idea to let the DB
> maintain data integrity as 
> much as possible. OJB was designed to work smoothly
> with existing databases.
> The ODMG transaction manager also takes care not to
> conflict with 
> database foreign key constraints.
> 
> If you want to sync OJB and non-OJB apps working
> against the same db you 
> have to take care of at least two issues:
> 1. Autoincremented Sequence Numbers. The Default OJB
> SequenceManager is 
> not aware of external processes. So you have to use
> a SequenceManager 
> implementation that uses database managed sequence
> numbers (or 
> Identies). There are several such implementations in
> the sequenceManager 
> package.
> 
> 2. All processes working against the db should use
> optimistic locking to 
> avoid data disintegrity. OJB supports OL based on
> Version and timestamp 
> columns.
> 
> > 
> > My compliments to Thomas, Armin, and the team that
> >

Re: regression test errors

2003-03-29 Thread Michael Duffy

Thanks to both Thomas and Armin for their replies on
this thread.

Speaking for myself, I'm nervous about using OJB on my
current project, too, but I don't think the source is
entirely OJB.  A big part of it is fear of what I
DON'T know.  I very much liked the idea of using a
tool, developed by folks more expert than me.  I know
enought about JDBC to be able to do CRUD operations
and simple transactions, but the idea of having a
layer to abstract all that out of business objects was
appealing.

I heard Martin Fowler talk a few months ago.  He
mentioned using JAXOR as an O/R mapping tool.  When I
looked into it, I found NO documentation whatsoever.  

Google quickly turned up OJB as an alternative.  I
liked it right away, because it had more documentation
than JAXOR, it the cachet of being a Jakarta project,
and the stuff that I did actually worked.  Now I've
got a tree of four tables linked with m:n
associations, all working in JUnit tests.  

All that's well and good, but now I'm nervous about
that learning curve and what I'm ignorant of.  I've
done everything with the PersistenceBroker API because
it was easy to follow in the docs.  But now I'm
thinking that I should really be doing all of this
using ODMG API instead.  More learning, with a
deadline approaching.

Here's a fundamental question:

RDBMS developers have put a lot of effort into
maintaining referential integrity, managing
transactions, etc.  It seems to me that OJB is taking
over a lot of that stuff.  When I created my tables, I
didn't add foreign key constraints.  I left all that
to OJB.  The ODMG API will handle true transactions
and object/row locking.

But what if OJB isn't the only path into the database?
 A DBA might balk at leaving all those things that the
RDBMS would handle to OJB.  Is it possible still leave
foreign key constraints in the database so others
could use them without OJB?

My compliments to Thomas, Armin, and the team that
created OJB.  None of this fear is a reflection on
your excellent work.  It has more to do with the fact
that this is still a version 1.0 release candidate and
my own ignorance.  Sincerely, MOD
 

--- Thomas Mahler <[EMAIL PROTECTED]> wrote:
> Hi Bonnie,
> 
> Bonnie MacKellar wrote:
> > I was not at Mobius before 1999, so I really would
> not know...
> > 
> > Yes, this is for an important project and I am not
> feeling
> > very good about this. The alternatives though, are
> to buy
> > something or do it ourselves. Our company tends to
> be of
> > the "do it yourself"  mentality. Since what we
> need is exactly
> > what OJB provides, it seems silly to replicate it.
> > On the other hand, it is often easier to deal with
> bugs
> > in your own code then with bugs in someone else's
> code.
> 
> OJB is 3 years of heavy designed code by experts in
> the O/R area.
> We have a complete regression testsuite that covers
> each and every 
> aspect of the system.
> 
> Do it yourself is definitely a bad idea in this
> area. If you don't trust 
> us better use a commercial tool like TopLink.
> 
> OJB is in production use in large projects for 2
> years now.
> My company is using OJB in several large and mission
> critical software 
> projects since a year now.
> 
> > 
> > I would feel a lot better about this if the mail
> archives
> > worked. My usual approach with this kind of system
> is
> > to really sift through user archives, looking for
> similar
> > experiences.
> 
> I admit this is really annoying. But this is clearly
> not an OJB problem, 
> but an infrastructure problem with some Apache
> server.
> For the time being use archive mirrors at GMANE or
> at 
>
http://www.mail-archive.com/ojb-user%40db.apache.org/
> 
> cheers,
> Thomas
> 
> > 
> > Bonnie
> > 
> > -Original Message-
> > From: Michael Duffy [mailto:[EMAIL PROTECTED]
> > Sent: Friday, March 28, 2003 1:19 PM
> > To: OJB Users List
> > Subject: RE: regression test errors
> > 
> > 
> > 
> > Bonnie, 
> > 
> > I'm responding to a note you sent to the OJB
> mailing
> > list.
> > 
> > Is Mobius based in the NYC area?  I knew a guy
> named
> > Howard Deiner who worked at a company named
> Mobius. 
> > His tenure would have been prior to 1999.  Just
> > curious.  
> > 
> > Also curious - will the system you'll be
> installing
> > OJB into be a large production application?  I've
> been
> > getting OJB up and running for a smaller
> production
> > project, and I'm nervous about it.  I see all the
> > problems on the mailing list and sketchy
> documentation
&g

RE: regression test errors

2003-03-28 Thread Michael Duffy

Bonnie, 

I'm responding to a note you sent to the OJB mailing
list.

Is Mobius based in the NYC area?  I knew a guy named
Howard Deiner who worked at a company named Mobius. 
His tenure would have been prior to 1999.  Just
curious.  

Also curious - will the system you'll be installing
OJB into be a large production application?  I've been
getting OJB up and running for a smaller production
project, and I'm nervous about it.  I see all the
problems on the mailing list and sketchy documentation
and wonder what I'm getting myself into.  JMHO, of
course.  Are you feeling the same way?  Thanks - MOD


--- Bonnie MacKellar <[EMAIL PROTECTED]> wrote:
> 
> Thanks for the advice.
> This parameter is set in
>
C:\db-ojb-1.0.rc1\target\test\ojb\repository_database.xml,
> right? Do I need to change anything else to modify
> this behavior?
> 
> I'm still trying to feel my way around this system.
> Basically, I have
> about a week to make a recommendation on using it,
> in a large project.
> Ease of use is an important consideration,
> especially to the powers-that-be
> who are managing this project.
> 
> Bonnie
> 
> -Original Message-
> From: Armin Waibel
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 26, 2003 6:42 PM
> To: OJB Users List
> Subject: Re: regression test errors
> 
> Seems a problem with the used sequence manager
> (SequenceManagerHighLowImpl).
> Try to run the test cases with
> SequenceManagerInMemoryImpl
> Do you get the same results?
> 
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to use Criteria.addEqualByColumn

2003-03-21 Thread Michael Duffy

Jakob, 

I'm a bozo.  It was operator error (again).  The m:n
stuff is working fine in both directions.  I apologize
for bothering you.  Sincerely, MOD


--- Jakob Braeuchi <[EMAIL PROTECTED]> wrote:
> hi michael,
> 
> ojb handles non-decomposed m:n relationships
> internally. there's no need 
> for you to deal with the intermediate table.
> 
> jakob
> 
> Michael Duffy wrote:
> 
> >I have an m:n relationship between two
> tables/classes
> >A and B, modeled with an A_TO_B intermediate table
> >in-between.
> >
> >I'd like to get all the instances of B associated
> with
> >a given A as a Collection.  The SQL might look
> like:
> >
> >SELECT * FROM B
> >WHERE 
> >B.B_ID = A_TO_B.B_ID AND
> >A_TO_B.A_ID = X;
> >
> >where X is the value of the A.A_ID that I want.
> >
> >Is Criteria.addEqualToColumn the right method, or
> >should I just toss in raw SQL using SQLCriteria? 
> How
> >do I get back the Collection if I use raw SQL?  Any
> >advice is most welcome.
> >
> >Also, the list is broken on the db.apache.org Web
> >site.  Notes younger than 24Feb2003 don't appear. 
> >Thanks - MOD
> >
> >
> >__
> >Do you Yahoo!?
> >Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your desktop!
> >http://platinum.yahoo.com
> >
>
>-
> >To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to use Criteria.addEqualByColumn

2003-03-21 Thread Michael Duffy

Hi, Jakob!

I've been having some trouble navigating this.  (I
suspect it's newbie problems.)  I have m:n
relationships working fine with a single pair of
objects, but when I try to turn them on between four
sets of objects I get exceptions in my JUnit tests.

They're all working in one direction (from top to
bottom: A->B->C->D), but not bi-directionally.

Another question: I hae a foreign key relationship
between two classes where I want to pull two column
values out of a table and populate member data in a
class.  I only see one table attribute in the
.  When I want to point to foreign
key using , it's almost as if I
HAVE to map the value I want to a class with its own
table.  

The repository.xml docs say that the table attribute
on  may specify a table different
from the mapped table for the persistent class, but
it's currently not implemented. 

Do I really have to wrap a java.util.Date in a
separate class in this case, or is there another way
to do it?  Thanks - MOD


--- Jakob Braeuchi <[EMAIL PROTECTED]> wrote:
> hi michael,
> 
> ojb handles non-decomposed m:n relationships
> internally. there's no need 
> for you to deal with the intermediate table.
> 
> jakob
> 
> Michael Duffy wrote:
> 
> >I have an m:n relationship between two
> tables/classes
> >A and B, modeled with an A_TO_B intermediate table
> >in-between.
> >
> >I'd like to get all the instances of B associated
> with
> >a given A as a Collection.  The SQL might look
> like:
> >
> >SELECT * FROM B
> >WHERE 
> >B.B_ID = A_TO_B.B_ID AND
> >A_TO_B.A_ID = X;
> >
> >where X is the value of the A.A_ID that I want.
> >
> >Is Criteria.addEqualToColumn the right method, or
> >should I just toss in raw SQL using SQLCriteria? 
> How
> >do I get back the Collection if I use raw SQL?  Any
> >advice is most welcome.
> >
> >Also, the list is broken on the db.apache.org Web
> >site.  Notes younger than 24Feb2003 don't appear. 
> >Thanks - MOD
> >
> >
> >__
> >Do you Yahoo!?
> >Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your desktop!
> >http://platinum.yahoo.com
> >
>
>-
> >To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> >For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



m:n Chaining

2003-03-20 Thread Michael Duffy

I've worked through the Person/Project m:n example and
gotten everything working.  

The real problem that I'm trying to model is a
four-level tree: four tables (A, B, C, D) with m:n
relationships between each.

I've been unsuccessful at getting all the
relationships working.  I've managed to get them from
the top down (A->B->C->D), but not from the bottom up.
 

Has anyone else tried something like this?  Thanks-MOD

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to use Criteria.addEqualByColumn

2003-03-20 Thread Michael Duffy

I have an m:n relationship between two tables/classes
A and B, modeled with an A_TO_B intermediate table
in-between.

I'd like to get all the instances of B associated with
a given A as a Collection.  The SQL might look like:

SELECT * FROM B
WHERE 
B.B_ID = A_TO_B.B_ID AND
A_TO_B.A_ID = X;

where X is the value of the A.A_ID that I want.

Is Criteria.addEqualToColumn the right method, or
should I just toss in raw SQL using SQLCriteria?  How
do I get back the Collection if I use raw SQL?  Any
advice is most welcome.

Also, the list is broken on the db.apache.org Web
site.  Notes younger than 24Feb2003 don't appear. 
Thanks - MOD


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



m:n Question

2003-03-19 Thread Michael Duffy

I've got an m:n association that's causing me a
problem.

Let's say I have two Java classes, A and B, that have
underlying database tables and an m:n association
between them.  Both A and B have members of type
java.util.Collection that maintain references to the
other.

I have a constructor for A that allows me to create an
empty collection of B references.  

When I test creating and storing an instance of class
A with an empty collection of B references OJB throws
a java.util.NoSuchElementException: "Thrown by the
nextElement method of an Enumeration to indicate that
there are no more elements in the enumeration."

Does OJB not allow me to persist an instance of class
A which has no references to class B, or have I made
another newbie mistake?   Thank you. - MOD


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Query against Collection with more than one addEqualTo statement.

2003-03-18 Thread Michael Duffy

The empty collection result makes perfect sense if the
default behavior is to AND criteria together.  None of
your articles have both names set (exclusion at work),
so nothing comes back.

Aren't you trying to say "Give me all the articles
where name = 'Article 1' OR name = 'Article 2'"?

If I understand correctly, I think you want to use
either the addOrCriteria or addIn methods. - MOD

--- Gregor Heinze <[EMAIL PROTECTED]> wrote:
> For the sake of simplicity, I refer to the class
> model from the tutorial
> "Advanced Object Relational Mapping techniques" to
> explain my problem. It
> seems to be quite simple but I wasn't able to figure
> it out correctly.
> All I want to do is to get all ProductGroup's which
> have an Article with the
> articleName "Article 1" _and_ an Article with the
> articleName "Article 2" in
> its allArticlesInGroup Vector.
> Using the PersistenceBroker API I wrote the
> following:
> 
> Criteria crit = new Criteria();
> crit.addEqualTo("allArticlesInGroup.articleName",
> "Article 1");
> crit.addEqualTo("allArticlesInGroup.articleName",
> "Article 2");
> Query q = QueryFactory.newQuery(ProductGroup.class,
> crit);
> 
> Unfortunately this approach does not work and I
> always get an empty result
> collection. Using only one addEqualTo statement
> works as expected but using
> two of them won't.
> Anyone has an idea how to do this? Any help is
> appreciated!
> 
> Thanks in advanced,
>  Gregor
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Adding A New Component With A 1:1 Relationship

2003-03-18 Thread Michael Duffy

Thomas,

Of course you're correct.  I'd added foreign key
constraints to all my tables.  Once I removed them,
OJB did the INSERT and managed all the keys for me, as
you said.  I apologize for missing that subtlety.  

Should I also remove foreign key constraints on
many-to-many tables?  I've got three of them in this
schema.  Will OJB handle those as nicely as the 1:1?

"...I agree, there is a learning curve with OJB. O/R
mapping is not trivial.  But it is worth the effort.
Once you mastered the learning curve you will ask
yourself, how could I write database applications
without an O/R tool?..." - I totally agree with this
statement.  That's why I'm persisting with OJB, even
if it makes me nervous about my release date.  

IMHO, two great benefits of an object/relational
mapping layer are that they force SQL code out of the
business objects and they allow CMP without entity
EJBs.  You can write J2EE without an app server; J2EE
and EJB need not be synonymous.  

Thank you again for your fine work and timely advice. 
Sincerely, MOD


--- Thomas Mahler <[EMAIL PROTECTED]> wrote:
> Hi Michael,
> 
> Michael Duffy wrote:
> > I have a newbie question, if you don't mind.
> > 
> > Your advanced O/R tutorial shows a 1:1 mapping
> example
> > with Article and ProductGroup classes.  You've
> shown
> > the table schemas (in German, but I follow you)
> and
> > the repository_user.xml.  All very good, of
> course.  
> > 
> > The repository XML for Article has a
> productGroupId
> > that points to the ProductGroup key, and an
> instance
> > of ProductGroup that is supposed to be owned by
> the
> > Article.
> > 
> > Now if I want to ask the broker to store a brand
> new
> > Article, how do I do it?  Is the productGroupId
> > required to be set to an existing before I call
> > broker.store(newArticle)?  
> 
> Depends on the database. If there is a FK constraint
> then yes.
> But as you can see from the table schema, there are
> no formal FK 
> constraints. So, the productGroupId needs not to be
> filled.
> 
> > If I want to have a new
> > ProductGroup for my Article, do I have to do this
> as a
> > five-step transaction?
> > 
> > 1. Create a new ProductGroup instance
> > 2. Store the new ProductGroup instance
> > 3. Get the latest ProductGroup instances's primary
> key
> > 4. Create a new Article, using the PG primary key
> > 5. Store the new Article
> 
> No it's much easier, as OJB takes care of FK
> assigment automatically:
> 1. Create a new Article a
> 2. Create a new ProductGroup instance pg
> 3. call a.setProductGroup(pg)
> 4. store the new Article.
> 
> OJB manages the FK assignment for you. If you have
> set 
> auto-update="true" on the productGroup
> reference-descriptor then OJB 
> will also store the new PG on storing the new
> article!
> 
> 
> > I'm sure it's my lack of understanding, because
> this
> > feels very difficult.  I'm still climbing that OJB
> > learning curve.
> 
> I agree, there is a learning curve with OJB. O/R
> mapping is not trivial. 
> But it is worth the effort. Once you mastered the
> learning curve you 
> will ask yourself, how could I write database
> applications without an 
> O/R tool?
> 
> cheers,
> Thomas
> 
> > 
> > Thank you for your work, help, and patience. 
> > Sincerely, MOD
> > 
> > 
> > __
> > Do you Yahoo!?
> > Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your desktop!
> > http://platinum.yahoo.com
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Adding A New Component With A 1:1 Relationship

2003-03-17 Thread Michael Duffy

I have a newbie question, if you don't mind.

Your advanced O/R tutorial shows a 1:1 mapping example
with Article and ProductGroup classes.  You've shown
the table schemas (in German, but I follow you) and
the repository_user.xml.  All very good, of course.  

The repository XML for Article has a productGroupId
that points to the ProductGroup key, and an instance
of ProductGroup that is supposed to be owned by the
Article.

Now if I want to ask the broker to store a brand new
Article, how do I do it?  Is the productGroupId
required to be set to an existing before I call
broker.store(newArticle)?  If I want to have a new
ProductGroup for my Article, do I have to do this as a
five-step transaction?

1. Create a new ProductGroup instance
2. Store the new ProductGroup instance
3. Get the latest ProductGroup instances's primary key
4. Create a new Article, using the PG primary key
5. Store the new Article

I'm sure it's my lack of understanding, because this
feels very difficult.  I'm still climbing that OJB
learning curve.

Thank you for your work, help, and patience. 
Sincerely, MOD


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to obtain the SQL code from a Query object?

2003-03-17 Thread Michael Duffy

I don't have javadocs for the
org.apache.ojb.broker.accesslayer.sql package.  Have I
gotten mine from the wrong place?  Thanks - MOD


--- Mahler Thomas <[EMAIL PROTECTED]> wrote:
> Mhh,
> 
> I don't know all API changes since 0.9.5 by heart,
> but the
> SqlGeneratorFactory is really a very old piece of
> code.
> have a look in the
> org.apache.ojb.broker.accesslayer.sql package
> 
> Maybe you can also instaiate SqlGenerator directly?!
> 
> cheers,
> Thomas
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 17, 2003 4:30 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: how to obtain the SQL code from a
> Query object?
> > 
> > 
> > Thomas,
> > 
> > Thanks for your help!
> > 
> > How do you use this SqlGeneratorFactory. This
> class doesn't 
> > seem to be in OJB 0.9.5.
> > 
> > I think that I could migrate to 1.0 but I don't
> know what 
> > exactly I will have to change in my code.
> > 
> > Best.
> > Sylvain
> > 
> > -Message d'origine-
> > De: Mahler Thomas
> [mailto:[EMAIL PROTECTED]
> > Date: lundi, 17. mars 2003 16:12
> > À: 'OJB Users List'
> > Objet: RE: how to obtain the SQL code from a Query
> object?
> > 
> > 
> > Hi Sylvain,
> > 
> > I think so!
> > But you can use the SqlGeneratorFactory to obtain
> a 
> > SqlGenerator instance
> > instead!
> > 
> > cheers,
> > Thomas
> > 
> > > -Original Message-
> > > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Monday, March 17, 2003 3:59 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: how to obtain the SQL code from a
> Query object?
> > > 
> > > 
> > > Hi Thomas,
> > > 
> > > I can't find the broker.serviceSqlGenerator()
> method.
> > > 
> > > I'm using OJB 0.9.5.
> > > Is it the problem?
> > > 
> > > Thanks
> > > Sylvain
> > > 
> > > 
> > > 
> > > -Message d'origine-
> > > De: Mahler Thomas
> [mailto:[EMAIL PROTECTED]
> > > Date: lundi, 17. mars 2003 10:59
> > > À: 'OJB Users List'
> > > Objet: RE: how to obtain the SQL code from a
> Query object?
> > > 
> > > 
> > > The Query object is not able to return SQL code,
> as it does 
> > > not have any
> > > platform specific know how.
> > > You have to ask the OJB SqlGenerator component
> to generate SQL:
> > > 
> > > PersistenceBroker broker = ...
> > > Query query = ...;
> > > ClassDescriptor cld = ...;
> > > 
> > > // obtain prepared stmt sql:
> > > String sql = 
> > >
>
broker.serviceSqlGenerator().getPreparedSelectStatement(query,
> > > cld);
> > > 
> > > // obtain no prepared sql: 
> > > sql = 
> >
>
broker.serviceSqlGenerator().getSelectStatementDep(query,
> cld);
> > > 
> > > cheers,
> > > thomas
> > > 
> > > > -Original Message-
> > > > From: [EMAIL PROTECTED] 
> > > [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, March 17, 2003 10:32 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: how to obtain the SQL code from a
> Query object?
> > > > 
> > > > 
> > > > Hello,
> > > > 
> > > > I have this query:
> > > > 
> > > > code
> > > > Criteria crit = new Criteria();
> > > > crit.addEqualTo("workstationName", "U68111");
> > > > 
> > > > Query query = new
> QueryByCriteria(Workstation.class, crit, true);
> > > > code
> > > > 
> > > > Is there a way to obtain the SQL query (select
> * from 
> > > > Workstation where) from the query object?
> > > > 
> > > > Thanks
> > > > Sylvain
> > > > 
> > > > 
> > > 
> >
>
-
> > > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > > 
> > > > 
> > > 
> > > 
> > > 
> >
>
-
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > 
> > > 
> > > 
> >
>
-
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ojb v0.9.9 problem

2003-02-21 Thread Michael Duffy
I, too, experienced the same problem that Jemmee Yung
and Ferran Parra did.  Jemmee's solution, changing the
jcd-alias in repository.xml to read "repository.xml"
does indeed work.  Thank you, Jemmee, for pushing my
efforts forward.

But personally I'm not satisfied with this.  I'd like
to know if the workaround is a bug or a fundamental
misunderstanding on my part.  I thought the jcd-alias
value was supposed to be used for lookups.  (That's
the way I used it in tutorial1.)

Can anybody tell me what the proper idiom is for
jdbc-alias?  Thanks - MOD



__
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]