You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Shane Mingins <sh...@assureinternational.com> on 2003/06/12 04:33:38 UTC

Any Good Resources?

Hi

I just wondered if there are any good resources out there for OJB and
specifically the ODMG API?

I see that there is one book that includes it "Professional Struts
Applications: Building Web Sites with Struts, Object Relational Bridge,
Lucene, and Velocity".

http://www.amazon.com/exec/obidos/ISBN%3D1861007817/hitchhikeguidetoA/103-97
96781-7623069

Has anyone read it?  

And there is the Beer4All Struts demo that uses OJB but only to read some
data from a database.

I am struggling with OJB and the ODMG API and would love either a good book
or good code examples if anyone knows of any available?  I have been google
searching to no avail.  

Cheers
Shane


Shane Mingins
Analyst Programmer
Assure NZ Ltd
Ph 644 494 2522



Re: [ojb] Re: Any Good Resources?

Posted by Federico Spinazzi <f....@masterhouse.it>.
Thomas Mahler wrote:

> Hi Shane,
>
> Shane Mingins wrote:
>
>> Hi
>>
>> I just wondered if there are any good resources out there for OJB and
>> specifically the ODMG API?
>>
>> I see that there is one book that includes it "Professional Struts
>> Applications: Building Web Sites with Struts, Object Relational Bridge,
>> Lucene, and Velocity".
>>
>> http://www.amazon.com/exec/obidos/ISBN%3D1861007817/hitchhikeguidetoA/103-97
>> 96781-7623069
>>
>> Has anyone read it?
>
>
> Not yet. I just ordered the book. I have not been contacted by the 
> authors, and I have not involved in reviewing the book.

I've read the book and I liked, didn't look at the downloaded code.
The chapter on OJB alone doesn't worth the buy: it is well written and 
full of explanations but doesn't add TOO much to the tutorial on ojb web 
site.
The interesting things about this book is that it tries to explain also 
the pattern standing behind an implementation (MVC for Struts, Data 
Access Object and Value Object for OJB).
As OR mapping is quite confusing for the various options you can have 
(see http://www.martinfowler.com/eaaCatalog/), mybe be worth reading.
Hope that helps.
Federico



Re: Any Good Resources?

Posted by Thomas Mahler <th...@web.de>.
Hi Shane,

Shane Mingins wrote:
> Hi
> 
> I just wondered if there are any good resources out there for OJB and
> specifically the ODMG API?
> 
> I see that there is one book that includes it "Professional Struts
> Applications: Building Web Sites with Struts, Object Relational Bridge,
> Lucene, and Velocity".
> 
> http://www.amazon.com/exec/obidos/ISBN%3D1861007817/hitchhikeguidetoA/103-97
> 96781-7623069
> 
> Has anyone read it?

Not yet. I just ordered the book. I have not been contacted by the 
authors, and I have not involved in reviewing the book.

All source code from the book can be found here:			<a 
href="http://web.wrox.com/download/code/professional/7817.zip">
Professional Struts and OJB sources.</a>

Another good book on OJB + Struts:
<a 
href="http://www.amazon.com/exec/obidos/ASIN/0596003285/qid=1054656123/sr=2-1/ref=sr_2_1/103-9325116-6675068">
The O'Reilly book on Struts programming by Chuck Cavaness has a
whole chapter about how to build an applications model layers based on OJB.
A must reading for everyone intending to use Struts and OJB.
</a>
All source code from the book can be found here:
<a href="http://examples.oreilly.com/jakarta/">
Struts Programming sources.
</a>

> 
> And there is the Beer4All Struts demo that uses OJB but only to read some
> data from a database.
> 
> I am struggling with OJB and the ODMG API and would love either a good book
> or good code examples if anyone knows of any available?  I have been google
> searching to no avail.  

The best resources on ODMG that I know of can be found at the POET 
community site:
http://community.fastobjects.com/community_documentation_oss61.htm

You have to register to their community site, but it's really worth it.

Of course they don't cover OJB, but their own products ;-)

cheers,
Thomas

> Cheers
> Shane
> 
> 
> Shane Mingins
> Analyst Programmer
> Assure NZ Ltd
> Ph 644 494 2522
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


Re: Inheritance

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Alexander,

I don't now if this will solve your problem,
but in current CVS version Identity class
(and some dependend classes) changed to
populate both
>   object real class = null;
>   pkvalues = 10;
>   object class = IBaseInterface.
objectRealClass and objectClass
(means topLevelClass).

Give it a try ;-)

regards,
Armin


----- Original Message -----
From: "Alexander Prozor" <ap...@isd.dp.ua>
To: <oj...@db.apache.org>
Sent: Thursday, June 12, 2003 8:04 AM
Subject: Inheritance


> Hi Experts,
> We have object hierarchy :
> base interface IBaseInterface,
> and classes that implements it Class0, Class1, Class2
> Class0 has reference to the Class1
> in the tables for these classes we got identical value of primary
> keys. (i.e. Class1 pk = 10 and Class2 pk = 10 ).
> when we try to search for Class0 instances via ODMG OQL query.
> something like this:
>           select classes from Class0 where name = 'testClass'
> in PersistentBrokerImpl.getReferencedObject
> Ojb takes Top level Class for Class1 (
> DescriptionRepository.getTopLevelClass()).
> and Identity:
>   object real class = null;
>   pkvalues = 10;
>   object class = IBaseInterface.
>
> and trying to set Class2 object instead of Class1.
> So we got exception:
>
> java.lang.IllegalArgumentException: field type mismatch
>         at
org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReference(Persi
stenceBrokerImpl.java:1049)
>         at
org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReferences(Pers
istenceBrokerImpl.java:1027)
>         at
org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIt
erator.java:462)
>         at
org.apache.ojb.broker.accesslayer.RsIterator.next(RsIterator.java:270)
>         at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Pe
rsistenceBrokerImpl.java:1418)
>         at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Pe
rsistenceBrokerImpl.java:1468)
>         at
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Pe
rsistenceBrokerImpl.java:1429)
>         at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQu
ery(DelegatingPersistenceBroker.java:292)
>         at
org.apache.ojb.odmg.oql.OQLQueryImpl.execute(OQLQueryImpl.java:339)
>
> How can we set real class?
> Maybe it's better to use another query ( PersistentBroker API ).
>
> --
> Best regards,
>  Alexander                            mailto:apro@isd.dp.ua
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



Inheritance

Posted by Alexander Prozor <ap...@isd.dp.ua>.
Hi Experts,
We have object hierarchy :
base interface IBaseInterface,
and classes that implements it Class0, Class1, Class2
Class0 has reference to the Class1
in the tables for these classes we got identical value of primary
keys. (i.e. Class1 pk = 10 and Class2 pk = 10 ).
when we try to search for Class0 instances via ODMG OQL query.
something like this:
          select classes from Class0 where name = 'testClass'
in PersistentBrokerImpl.getReferencedObject
Ojb takes Top level Class for Class1 (
DescriptionRepository.getTopLevelClass()).
and Identity:
  object real class = null;
  pkvalues = 10;
  object class = IBaseInterface.
  
and trying to set Class2 object instead of Class1.
So we got exception:

java.lang.IllegalArgumentException: field type mismatch
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReference(PersistenceBrokerImpl.java:1049)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.retrieveReferences(PersistenceBrokerImpl.java:1027)
        at org.apache.ojb.broker.accesslayer.RsIterator.getObjectFromResultSet(RsIterator.java:462)
        at org.apache.ojb.broker.accesslayer.RsIterator.next(RsIterator.java:270)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1418)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1468)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1429)
        at org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:292)
        at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(OQLQueryImpl.java:339)

How can we set real class?
Maybe it's better to use another query ( PersistentBroker API ).

-- 
Best regards,
 Alexander                            mailto:apro@isd.dp.ua