db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (OJB-48) Feature Request: Support of non-static inner classes.
Date Sun, 09 Apr 2006 18:04:26 GMT
     [ http://issues.apache.org/jira/browse/OJB-48?page=all ]
     
Thomas Dudziak resolved OJB-48:
-------------------------------

    Resolution: Fixed

There was a small bug in OJB in that non-public constructors were not found. Other than that,
the implementation works and the test case that you provided, is in error. I've added a testcase
to OJB based on yours (http://svn.apache.org/viewcvs.cgi/db/ojb/trunk/src/test/org/apache/ojb/broker/InnerClassTest2.java?view=markup)
which differs in the one important point: The outer class does not have a reference to the
inner class, especially not in the database. In the original test case, there were a bi-directional
foreignkey in the database between the outer class and the inner class which obviously leads
to errors. Rather, the outer class has a collection of inner class objects much like the mapping
in the language which is a 1:n due to the back-reference of the inner object via the OuterClass.this-reference.
This collection together with the corresponding reference from the inner class to the outer
class implement the bi-directional relationship between the two with only one foreignkey (from
inner to outer). One important detail of the collection is that it ought to be a proxy collection.
The reason is that due to the context in which the outer instance is materialized, a non-proxy
collection would result in two different objects of the inner class, one originally loaded
and the other one loaded because of the collection. With a proxy collection and proper object-cache
setting, the same object is used (as is shown in the unit test).


> Feature Request: Support of non-static inner classes.
> -----------------------------------------------------
>
>          Key: OJB-48
>          URL: http://issues.apache.org/jira/browse/OJB-48
>      Project: OJB
>         Type: New Feature

>   Components: PB-API
>     Versions: 1.1 CVS
>     Reporter: Michael Kröz
>     Assignee: Thomas Dudziak
>     Priority: Minor
>      Fix For: 1.1 CVS
>  Attachments: TestInnerClasses.java, ojb-blank-1-1-head.jar
>
> As important part of a project, talked about with Thomas Dudziak,
> it would be nice to have the feature supporting non-static inner
> classes of the style
>    class A {
>       class B {
>       }
>    }
> This feature request will use another feature request, the support
> of arguments for the constructor of a class. 
> Regards
> Michael Kröz

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message