RE: Inheritance querying problem

2003-09-13 Thread Gelhar, Wallace Joseph
Hi shibin,

Maybe I'm restating the obvious, but if A is concrete and B extends A,
why should a query for A objects return B objects?  If you do not define
B to be an extent of A, the query should not return B objects.  Have you
tried using the "super" reference descriptor to define the mapping
strategy *and* define B as an extent to add it the query domain of A?

IMO OJB should function this way to make the query domain of a class
customizable.

Just my .02 worth

Wally

 
-Original Message-
From: shibin ck [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 13, 2003 6:14 AM
To: OJB Users List
Subject: Re: Inheritance querying problem 

Hi,
Thank you very much for replying. 
 Actually my problem is not of aggregation, its of inheritance. B is
inheriting from A. You need not have an attribute of A in B for this.  
the "super" attribute in reference descriptor is not an actual attribute
of B , but it is used to inform ojb that A is the super class of B
 
here is a snip from  http://db.apache.org/ojb/tutorial3.html(
Advanced Object Relational Mapping techniques --->  mapping inheritance
hierarchies ---> mapping classes on multiple joined tables)
=
As you can see from this mapping we need a special reference-descriptor
that advises OJB to load the values for the inherited attributes from
class A by a JOIN using the (B.id == A.id) foreign key reference.

The name="super" is not used to address an actual attribute of the class
B but as a marker keyword defining the JOIN to the baseclass. 
==
 
This strategy is one of the three strategies used for mapping
inheritance hierarchies to tables. I get objects of both A and B when
queried on class A  If i use other strategies (using  tag)
. But when i use "super" method , i only get A objects (B objects are
stripped to A so i dont get B's attributes).
Since table structures are already decided in our project, we have to
use "super" method.
 
Again my goal is to query on A.class to retrive objects of both A.class
and B.class
 
Thanks
shibin
 

LAURENT Stephane <[EMAIL PROTECTED]> wrote:
Sorry but when I look this :


I think your class is like this :
class B 
{
private int id;
private String email;
private A super;

/* getters and setters*/
} 

So, it's an agregation (also extends but where is your type A attribute
in B ?) and you can add criteria("B.super",null)

Not sure to understand your goal ...


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

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



Re: Problem with mapping classes on multiple joined tables

2003-09-13 Thread Necro
Jakob Braeuchi wrote:
> hi christof,

hi,

> have you tried auto-update=true ?

Yes i already set auto-update=true as you mentioned in your last
mail. This made it possible to store objects of type B (the
repository.xml is shown in one of my last mails). when auto-update
is set to false, only parts of the object are stored in the database.

But when i select an object from the database the members of the
super class are set to null in both cases. These values aren't
even looked up in the database (according to the select statements
sent to the database).


Stupid question, this is not the way it is supposed to work, is it?

> the problem is imo that  this must be false for odmg :(

But it seems to work nonetheless. At least i can see no difference
except for the fact that storing objects works if it is set to true.

Thanks for any advice or suggestion

christof

> 
> jakob
> 
> Necro wrote:
> 
>> Jakob Braeuchi wrote:
>> 
>> 
>>> hi christof,
>>> 
>>> this is a problem with your auto-update setting in the
>>> reference-desriptor pointing to the superclass.
>>> auto-update should be true.
>>> 
>>> 
>> 
>> Hi,
>> 
>> thanks, now inserting a value works just fine. But now I got
>> another problem. When I select an object of class B only the
>> members of B are set, all members inherited from A are set
>> to null. I tried to set auto-retrieve to true, but that does
>> not change anything.
>> 
>> I found a testcase in the class AnonymousFieldsTest, which does
>> something similar i want to do. Could it be that this does not
>> work with the odmg interface?
>> 
>> What can I do?
>> 
>> Thans in advance
>> 
>> christof


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



offtopic : returned mail ??

2003-09-13 Thread Jakob Braeuchi
hi all,

whenever i post a message to ojb-user i receive the following:

The original message was received at Sat, 13 Sep 2003 14:06:59 -0300
from localhost.localdomain [127.0.0.1]
  - The following addresses had permanent fatal errors -
guianla
   (reason: 550 5.1.1 User unknown)
   (expanded from: <[EMAIL PROTECTED]>)
computos
   (reason: 550 5.1.1 User unknown)
   (expanded from: <[EMAIL PROTECTED]>)
  - Transcript of session follows -
550 5.1.1 guianla... User unknown
550 5.1.1 computos... User unknown


Reporting-MTA: dns; riouruguay.com.ar
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Sat, 13 Sep 2003 14:06:59 -0300
Final-Recipient: RFC822; [EMAIL PROTECTED]
X-Actual-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Unix; 550 5.1.1 User unknown
Last-Attempt-Date: Sat, 13 Sep 2003 14:07:11 -0300
Final-Recipient: RFC822; [EMAIL PROTECTED]
X-Actual-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Unix; 550 5.1.1 User unknown
Last-Attempt-Date: Sat, 13 Sep 2003 14:07:11 -0300


Return-Path: <[EMAIL PROTECTED]>
Received: from patoruzu.ru (localhost.localdomain [127.0.0.1])
by riouruguay.com.ar (8.11.6/8.11.6) with ESMTP id h8DH6l021470
for <[EMAIL PROTECTED]>; Sat, 13 Sep 2003 14:06:59 -0300
X-Apparently-To: [EMAIL PROTECTED] via 216.136.226.39; Sat, 13 Sep 2003 10:09:33 -0700
Received: from 208.185.179.12  (HELO mail.apache.org) (208.185.179.12)
 by mta123.mail.scd.yahoo.com with SMTP; Sat, 13 Sep 2003 10:09:33 -0700
Received: (qmail 12870 invoked by uid 500); 13 Sep 2003 17:09:27 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: 
List-Subscribe: 
List-Help: 
List-Post: 
List-Id: "OJB Users List" 
Reply-To: "OJB Users List" <[EMAIL PROTECTED]>
Delivered-To: mailing list [EMAIL PROTECTED]
Received: (qmail 12855 invoked from network); 13 Sep 2003 17:09:26 -
Received: from unknown (HELO mail.gmx.net) (213.165.64.20)
 by daedalus.apache.org with SMTP; 13 Sep 2003 17:09:26 -
Received: (qmail 2893 invoked by uid 65534); 13 Sep 2003 17:09:29 -
Received: from adsl-62-167-38-164.adslplus.ch (EHLO gmx.ch) (62.167.38.164)
 by mail.gmx.net (mp002) with SMTP; 13 Sep 2003 19:09:29 +0200
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 13 Sep 2003 19:08:45 +0200
From: Jakob Braeuchi <[EMAIL PROTECTED]>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: OJB Users List <[EMAIL PROTECTED]>
Subject: [Rebote: ver fuente para direcciones invalidas] Re: Problem with
mapping classes on multiple joined tables
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]>
In-Reply-To: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Subject-anterior: Re: Problem with mapping classes on multiple joined tables
X-direccion-invalida: [EMAIL PROTECTED]


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


Re: Problem with mapping classes on multiple joined tables

2003-09-13 Thread Jakob Braeuchi
hi christof,

have you tried auto-update=true ?
the problem is imo that  this must be false for odmg :(
jakob

Necro wrote:

Jakob Braeuchi wrote:
 

hi christof,

this is a problem with your auto-update setting in the
reference-desriptor pointing to the superclass.
auto-update should be true.
   

Hi,

thanks, now inserting a value works just fine. But now I got
another problem. When I select an object of class B only the
members of B are set, all members inherited from A are set
to null. I tried to set auto-retrieve to true, but that does
not change anything.
I found a testcase in the class AnonymousFieldsTest, which does
something similar i want to do. Could it be that this does not
work with the odmg interface?
What can I do?

Thans in advance

christof

-
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]


reverse-db issue:

2003-09-13 Thread Jason Pyeron
any one get this before?

this was after the read button was pushed.

[EMAIL PROTECTED] db-ojb-1.0.rc4]$ ant reverse-db
Buildfile: build.xml

reverse-db:
[reversedb] Using MySQL-AB JDBC Driver 3.0.8-stable ( $Date: 2003/05/19 00:57:19 $, 
$Revision: 1.27.2.18 $ )
[reversedb] java.lang.NullPointerException
[reversedb] at 
org.apache.ojb.tools.mapping.reversedb.DBSchema.read(DBSchema.java:126)
[reversedb] at 
org.apache.ojb.tools.mapping.reversedb.DBCatalog.read(DBCatalog.java:164)
[reversedb] at org.apache.ojb.tools.mapping.reversedb.DBMeta.read(DBMeta.java:224)
[reversedb] at 
org.apache.ojb.tools.mapping.reversedb.gui.JFrmMainFrame.analyzeSchema(JFrmMainFrame.java:128)

Sincerely,

Jason Pyeron

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-   -
- Jason Pyeron   http://www.pyerotechnics.com   -
- Partner & Sr. Manager Pyerotechnics Development, Inc. -
-   500 West University Parkway #1S -
- +1 (410) 808-6646 Baltimore, Maryland  21210-3253 -
-   -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.






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



Trivial contribution: JavaDate2SqlBigIntFieldConversion.java

2003-09-13 Thread Steve Schwarz
Hi
I needed to map a rdbms field storing date and time in a single field (as a 
BIGINT) into a java.util.Date so I wrote this Field Conversion. Thought I'd 
offer it to anyone else who might benefit (from these four lines of code 
:^).

Steve

_
Express yourself with MSN Messenger 6.0 -- download now! 
http://www.msnmessenger-download.com/tracking/reach_general
package org.apache.ojb.broker.accesslayer.conversions;

/* 
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in
 *the documentation and/or other materials provided with the
 *distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *if any, must include the following acknowledgment:
 *   "This product includes software developed by the
 *Apache Software Foundation (http://www.apache.org/)."
 *Alternately, this acknowledgment may appear in the software itself,
 *if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Apache" and "Apache Software Foundation" and
 *"Apache ObjectRelationalBridge" must not be used to endorse or promote products
 *derived from this software without prior written permission. For
 *written permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called "Apache",
 *"Apache ObjectRelationalBridge", nor may "Apache" appear in their name, without
 *prior written permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * .
 */

/**
 * this implementation of the FieldConversion interface converts
 * between java.util.Date values and BigInt values in the rdbms.
 * @author		Steve Schwarz
 * @version $Id: JavaDate2SqlDateFieldConversion.java,v 1.3 2003/01/19 12:13:15 brj Exp $
 */
public class JavaDate2SqlBigIntFieldConversion implements FieldConversion
{

/*
 * @see FieldConversion#javaToSql(Object)
 */
public Object javaToSql(Object source)
{
if (source instanceof java.util.Date)
{
 	return new Long(((java.util.Date) source).getTime());
}
else
{
 	return source;
}
}

/*
 * @see FieldConversion#sqlToJava(Object)
 */
public Object sqlToJava(Object source)
{
if (source instanceof Long)
{
 	return new java.util.Date(((Long) source).longValue());
}
else
{
 	return source;
}
}

}


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

Re: Inheritance querying problem

2003-09-13 Thread shibin ck
Hi,
Thank you very much for replying. 
 Actually my problem is not of aggregation, its of inheritance. B is inheriting 
from A. You need not have an attribute of A in B for this.  
the "super" attribute in reference descriptor is not an actual attribute of B , but it 
is used to inform ojb that A is the super class of B
 
here is a snip from  http://db.apache.org/ojb/tutorial3.html(  Advanced Object 
Relational Mapping techniques --->  mapping inheritance hierarchies ---> mapping 
classes on multiple joined tables)
=
As you can see from this mapping we need a special reference-descriptor that advises 
OJB to load the values for the inherited attributes from class A by a JOIN using the 
(B.id == A.id) foreign key reference.

The name="super" is not used to address an actual attribute of the class B but as a 
marker keyword defining the JOIN to the baseclass. 
==
 
This strategy is one of the three strategies used for mapping inheritance hierarchies 
to tables. I get objects of both A and B when queried on class A  If i use other 
strategies (using  tag) . But when i use "super" method , i only get A 
objects (B objects are stripped to A so i dont get B's attributes).
Since table structures are already decided in our project, we have to use "super" 
method.
 
Again my goal is to query on A.class to retrive objects of both A.class and B.class
 
Thanks
shibin
 

LAURENT Stephane <[EMAIL PROTECTED]> wrote:
Sorry but when I look this :


I think your class is like this :
class B 
{
private int id;
private String email;
private A super;

/* getters and setters*/
} 

So, it's an agregation (also extends but where is your type A attribute in B ?) and 
you can add criteria("B.super",null)

Not sure to understand your goal ...


-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Re: dynamci Proxy: ClassCastException with Interfaces

2003-09-13 Thread Joerg Lensing
Edson Carlos Ericksson Richter wrote:

Ok, I've not asked yet: what version of OJB are you using?

 

I'm using rc 3

joerg



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