db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb repository_junit.xml
Date Tue, 13 Jul 2004 11:37:57 GMT
brj         2004/07/13 04:37:57

  Modified:    src/test/org/apache/ojb/broker ObjectRepository.java
                        PersistenceBrokerTest.java
               src/schema ojbtest-schema.xml
               src/java/org/apache/ojb/broker/query
                        ReportQueryByMtoNCriteria.java
                        QueryByMtoNCriteria.java QueryByCriteria.java
                        Criteria.java QueryFactory.java
                        ReportQueryByCriteria.java
               src/java/org/apache/ojb/broker/core
                        PersistenceBrokerImpl.java
               src/java/org/apache/ojb/broker/util BrokerHelper.java
               src/test/org/apache/ojb repository_junit.xml
  Log:
  first version to support mixed mapping
  
  Revision  Changes    Path
  1.9       +72 -3     db-ojb/src/test/org/apache/ojb/broker/ObjectRepository.java
  
  Index: ObjectRepository.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/ObjectRepository.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ObjectRepository.java	12 Jul 2004 10:19:23 -0000	1.8
  +++ ObjectRepository.java	13 Jul 2004 11:37:56 -0000	1.9
  @@ -147,7 +147,7 @@
           }
       }
   
  -    public static abstract class AB implements Serializable
  +    public static abstract class AB extends ABE implements Serializable
       {
           /** the special attribute telling OJB which concrete class this Object has.
            * NOTE: this attribute MUST be called ojbConcreteClass
  @@ -170,10 +170,15 @@
           }
       }
   
  +   
       public static interface AAlone
       {
       }
   
  +    public static abstract class ABE implements Serializable
  +    {
  +    }
  +
       public static class A extends AB implements AAlone
       {
           int id;
  @@ -355,7 +360,7 @@
           }
       }
   
  -    public static class E implements Serializable
  +    public static class E extends ABE implements Serializable
       {
           Integer id;
           protected int someSuperValue;
  @@ -379,8 +384,72 @@
           {
               this.someSuperValue = someSuperValue;
           }
  +        
       }
   
  +    public static abstract class LMNO implements Serializable
  +    {
  +        Integer id;
  +        protected int someValue;
  +    
  +        public Integer getId()
  +        {
  +            return id;
  +        }
  +    
  +        public void setId(Integer id)
  +        {
  +            this.id = id;
  +        }
  +    
  +        public int getSomeValue()
  +        {
  +            return someValue;
  +        }
  +    
  +        public void setSomeValue(int someSuperValue)
  +        {
  +            this.someValue = someSuperValue;
  +        }
  +    }
  +    
  +    public static class L extends LMNO
  +    {
  +    }
  +    
  +    public static class M extends LMNO
  +    {
  +        private String ojbConcreteClass;
  +
  +        public M()
  +        {
  +            setOjbConcreteClass(M.class.getName());
  +        }    
  +
  +        public String getOjbConcreteClass()
  +        {
  +            return ojbConcreteClass;
  +        }
  +
  +        public void setOjbConcreteClass(String ojbConcreteClass)
  +        {
  +            this.ojbConcreteClass = ojbConcreteClass;
  +        }
  +        
  +    }
  +    
  +    public static class N extends M
  +    {
  +        public N()
  +        {
  +            setOjbConcreteClass(N.class.getName());
  +        }    
  +    }
  +    
  +    public static class O extends LMNO
  +    {
  +    }
  +    
       /**
        * important note:
        * This class uses an anonymous field to hold the foreign key referencing to the parent
table.
  
  
  
  1.43      +100 -0    db-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java
  
  Index: PersistenceBrokerTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/broker/PersistenceBrokerTest.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- PersistenceBrokerTest.java	31 May 2004 22:57:21 -0000	1.42
  +++ PersistenceBrokerTest.java	13 Jul 2004 11:37:56 -0000	1.43
  @@ -600,6 +600,106 @@
       }
   
       /**
  +     * performs a test of an extent with one concrete class that uses
  +     * ojbConcreteClass identifier.
  +     */
  +    public void testMixedMapping1() throws Exception
  +    {
  +        // first delete all ObjectRepository.ABEs from database
  +        Collection allABE = null;
  +        Criteria c = null;
  +        Query q = QueryFactory.newQuery(ObjectRepository.ABE.class, c);
  +        allABE = broker.getCollectionByQuery(q);
  +        broker.beginTransaction();
  +        if (allABE != null)
  +        {
  +            Iterator iter = allABE.iterator();
  +            while (iter.hasNext())
  +            {
  +                broker.delete(iter.next());
  +            }
  +        }
  +        broker.commitTransaction();
  +
  +        // Insert 2 ObjectRepository.A
  +        ObjectRepository.A a1 = new ObjectRepository.A();
  +        ObjectRepository.A a2 = new ObjectRepository.A();
  +
  +        // Insert 1 ObjectRepository.B
  +        ObjectRepository.B b1 = new ObjectRepository.B();
  +
  +        // Insert 1 ObjectRepository.E
  +        ObjectRepository.E e1 = new ObjectRepository.E();
  +
  +        broker.beginTransaction();
  +        broker.store(a1);
  +        broker.store(a2);
  +        broker.store(b1);
  +        broker.store(e1);
  +        broker.commitTransaction();
  +
  +        Criteria selectAll = null;
  +
  +        q = QueryFactory.newQuery(ObjectRepository.ABE.class, selectAll);
  +        allABE = broker.getCollectionByQuery(q);
  +        assertEquals("collection size", 4, allABE.size());
  +        assertEquals("counted size", 4, broker.getCount(q));
  +    }
  +
  +    /**
  +     * performs a test of an extent with one concrete class that uses
  +     * ojbConcreteClass identifier.
  +     */
  +    public void testMixedMapping2() throws Exception
  +    {
  +        // first delete all ObjectRepository.LMNOs from database
  +        Collection allLMNO = null;
  +        Criteria c = null;
  +        Query q = QueryFactory.newQuery(ObjectRepository.LMNO.class, c);
  +        allLMNO = broker.getCollectionByQuery(q);
  +        broker.beginTransaction();
  +        if (allLMNO != null)
  +        {
  +            Iterator iter = allLMNO.iterator();
  +            while (iter.hasNext())
  +            {
  +                broker.delete(iter.next());
  +            }
  +        }
  +        broker.commitTransaction();
  +
  +        // Insert 2 ObjectRepository.L
  +        ObjectRepository.L l1 = new ObjectRepository.L();
  +        ObjectRepository.L l2 = new ObjectRepository.L();
  +
  +        // Insert 1 ObjectRepository.M
  +        ObjectRepository.M m1 = new ObjectRepository.M();
  +
  +        // Insert 1 ObjectRepository.N
  +        ObjectRepository.N n1 = new ObjectRepository.N();
  +
  +        // Insert 2 ObjectRepository.O
  +        ObjectRepository.O o1 = new ObjectRepository.O();
  +        ObjectRepository.O o2 = new ObjectRepository.O();
  +        
  +        broker.beginTransaction();
  +        broker.store(l1);
  +        broker.store(l2);
  +        broker.store(m1);
  +        broker.store(n1);
  +        broker.store(o1);
  +        broker.store(o2);
  +        broker.commitTransaction();
  +
  +        Criteria selectAll = null;
  +
  +        q = QueryFactory.newQuery(ObjectRepository.LMNO.class, selectAll);
  +        allLMNO = broker.getCollectionByQuery(q);
  +        assertEquals("collection size", 6, allLMNO.size());
  +        assertEquals("counted size", 6, broker.getCount(q));
  +    }
  +    
  +    /**
        * performs a test of the inheritance mapping to one table.
        */
       public void testMappingToOneTable() throws Exception
  
  
  
  1.83      +12 -1     db-ojb/src/schema/ojbtest-schema.xml
  
  Index: ojbtest-schema.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/schema/ojbtest-schema.xml,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- ojbtest-schema.xml	5 Jul 2004 14:46:26 -0000	1.82
  +++ ojbtest-schema.xml	13 Jul 2004 11:37:57 -0000	1.83
  @@ -128,12 +128,23 @@
       <column name="GROUP_ID" type="INTEGER"/>
     </table>
   
  +  <!-- 1 table , many classes -->
     <table name="AB_TABLE">
       <column name="ID" required="true" primaryKey="true" type="INTEGER"/>
  -    <column name="CLASS_NAME" type="VARCHAR" size="60"/>
  +    <column name="CLASS_NAME" required="true" primaryKey="true" type="VARCHAR" size="60"/>
       <column name="VALUE_" type="INTEGER"/>
       <column name="A_FIELD" type="VARCHAR" size="60"/>
       <column name="B_FIELD" type="VARCHAR" size="60"/>
  +  </table>
  +
  +  <table name="L_TABLE">
  +        <column name="ID" required="true" primaryKey="true" type="INTEGER"/>
  +        <column name="L_VALUE" type="INTEGER" />
  +  </table>
  +
  +  <table name="O_TABLE">
  +        <column name="ID" required="true" primaryKey="true" type="INTEGER"/>
  +        <column name="O_VALUE" type="INTEGER" />
     </table>
   
     <!-- Product Table for Tutorial 1, 2 & 4-->
  
  
  
  1.4       +12 -1     db-ojb/src/java/org/apache/ojb/broker/query/ReportQueryByMtoNCriteria.java
  
  Index: ReportQueryByMtoNCriteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/ReportQueryByMtoNCriteria.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReportQueryByMtoNCriteria.java	4 Apr 2004 23:53:36 -0000	1.3
  +++ ReportQueryByMtoNCriteria.java	13 Jul 2004 11:37:57 -0000	1.4
  @@ -70,6 +70,17 @@
   	}
   
   	/**
  +     * Copy Constructor
  +     * @param aQuery
  +     */
  +    public ReportQueryByMtoNCriteria(ReportQueryByMtoNCriteria aQuery)
  +    {
  +        super(aQuery);
  +        
  +        indirectionTable = aQuery.indirectionTable;
  +    }
  +	
  +	/**
   	 * @see org.apache.ojb.broker.query.MtoNQuery#getIndirectionTable()
   	 */
   	public String getIndirectionTable()
  
  
  
  1.8       +12 -1     db-ojb/src/java/org/apache/ojb/broker/query/QueryByMtoNCriteria.java
  
  Index: QueryByMtoNCriteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryByMtoNCriteria.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- QueryByMtoNCriteria.java	4 Apr 2004 23:53:36 -0000	1.7
  +++ QueryByMtoNCriteria.java	13 Jul 2004 11:37:57 -0000	1.8
  @@ -65,6 +65,17 @@
           this.indirectionTable = indirectionTable;
       }
   
  +	/**
  +     * Copy Constructor
  +     * @param aQuery
  +     */
  +    public QueryByMtoNCriteria(QueryByMtoNCriteria aQuery)
  +    {
  +        super(aQuery);
  +        
  +        indirectionTable = aQuery.indirectionTable;
  +    }
  +    
       /**
        * Insert the method's description here.
        * Creation date: (07.02.2001 22:01:55)
  
  
  
  1.28      +41 -2     db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java
  
  Index: QueryByCriteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryByCriteria.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- QueryByCriteria.java	5 Jul 2004 15:50:07 -0000	1.27
  +++ QueryByCriteria.java	13 Jul 2004 11:37:57 -0000	1.28
  @@ -53,7 +53,7 @@
       private boolean m_distinct = false;
       private Map m_pathClasses;
       private Criteria m_havingCriteria;
  -	private String m_objectProjectionAttribute;
  +    private String m_objectProjectionAttribute;
   
       // holding FieldHelper for orderBy and groupBy
       private List m_orderby = null;
  @@ -143,6 +143,45 @@
       public QueryByCriteria(Class aClassToSearchFrom)
       {
           this(aClassToSearchFrom, CRITERIA_SELECT_ALL);
  +    }
  +
  +    /**
  +     * Copy Constructor
  +     * @param aQuery
  +     */
  +    public QueryByCriteria(QueryByCriteria aQuery)
  +    {
  +        this (aQuery.getSearchClass());
  +        
  +        if (aQuery.getCriteria() != null)
  +        {
  +            setCriteria(aQuery.getCriteria().copy(true,true,true));
  +        }
  +        else
  +        {
  +            setCriteria(new Criteria());
  +        }
  +
  +        if (aQuery.getHavingCriteria() != null)
  +        {
  +            setHavingCriteria(aQuery.getHavingCriteria().copy(true,true,true));
  +        }
  +        else
  +        {
  +            setHavingCriteria(new Criteria());
  +        }
  +
  +        setDistinct(aQuery.isDistinct());
  +        setWithExtents(aQuery.getWithExtents());
  +        setStartAtIndex(aQuery.getStartAtIndex());
  +        setEndAtIndex(aQuery.getEndAtIndex());
  +        
  +        m_groupby = aQuery.m_groupby;
  +        m_orderby = aQuery.m_orderby;
  +        m_objectProjectionAttribute = aQuery.m_objectProjectionAttribute;
  +        m_pathClasses = aQuery.m_pathClasses;
  +        m_pathOuterJoin = aQuery.m_pathOuterJoin;
  +        m_prefetchedRelationships = aQuery.m_prefetchedRelationships;
       }
   
       /**
  
  
  
  1.46      +5 -62     db-ojb/src/java/org/apache/ojb/broker/query/Criteria.java
  
  Index: Criteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/Criteria.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Criteria.java	22 May 2004 08:37:23 -0000	1.45
  +++ Criteria.java	13 Jul 2004 11:37:57 -0000	1.46
  @@ -116,9 +116,9 @@
   
       /**
        * make a copy of the criteria
  -     * @param includeGroupBy if true
  -     * @param includeOrderBy if ture
  -     * @param includePrefetchedRelationships if true
  +     * @param includeGroupBy if true (groupBy is deprecated)
  +     * @param includeOrderBy if ture (orderBy is deprecated)
  +     * @param includePrefetchedRelationships if true (prefectchedRel. is deprecated)
        * @return a copy of the criteria
        */
       public Criteria copy(boolean includeGroupBy, boolean includeOrderBy, boolean includePrefetchedRelationships)
  @@ -289,8 +289,6 @@
        */
       public void addEqualTo(String attribute, Object value)
       {
  -    	// PAW
  -//		addSelectionCriteria(ValueCriteria.buildEqualToCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildEqualToCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -304,8 +302,6 @@
        */
       public void addColumnEqualTo(String column, Object value)
       {
  -    	// PAW
  -//		SelectionCriteria c = ValueCriteria.buildEqualToCriteria(column, value, getAlias());
   		SelectionCriteria c = ValueCriteria.buildEqualToCriteria(column, value, getUserAlias(column));
           c.setTranslateAttribute(false);
           addSelectionCriteria(c);
  @@ -321,8 +317,6 @@
        */
       public void addColumnEqualToField(String column, Object fieldName)
       {
  -    	// PAW
  -		//SelectionCriteria c = FieldCriteria.buildEqualToCriteria(column, fieldName, getAlias());
   		SelectionCriteria c = FieldCriteria.buildEqualToCriteria(column, fieldName, getUserAlias(column));
           c.setTranslateAttribute(false);
           addSelectionCriteria(c);
  @@ -339,8 +333,6 @@
        */
       public void addEqualToField(String attribute, String fieldName)
       {
  -		// PAW
  -		// FieldCriteria c = FieldCriteria.buildEqualToCriteria(attribute, fieldName, getAlias());
   		FieldCriteria c = FieldCriteria.buildEqualToCriteria(attribute, fieldName, getUserAlias(attribute));
           addSelectionCriteria(c);
       }
  @@ -356,8 +348,6 @@
        */
       public void addNotEqualToField(String attribute, String fieldName)
       {
  -        // PAW
  -		// SelectionCriteria c = FieldCriteria.buildNotEqualToCriteria(attribute, fieldName,
getAlias());
   		SelectionCriteria c = FieldCriteria.buildNotEqualToCriteria(attribute, fieldName, getUserAlias(attribute));
           addSelectionCriteria(c);
       }
  @@ -373,8 +363,6 @@
        */
       public void addNotEqualToColumn(String attribute, String colName)
       {
  -        // PAW
  -		// FieldCriteria c = FieldCriteria.buildNotEqualToCriteria(attribute, colName, getAlias());
   		FieldCriteria c = FieldCriteria.buildNotEqualToCriteria(attribute, colName, getUserAlias(attribute));
           c.setTranslateField(false);
           addSelectionCriteria(c);
  @@ -391,7 +379,6 @@
        */
       public void addEqualToColumn(String attribute, String colName)
       {
  -		// FieldCriteria c = FieldCriteria.buildEqualToCriteria(attribute, colName, getAlias());
   		FieldCriteria c = FieldCriteria.buildEqualToCriteria(attribute, colName, getUserAlias(attribute));
           c.setTranslateField(false);
           addSelectionCriteria(c);
  @@ -406,8 +393,6 @@
        */
       public void addGreaterOrEqualThan(Object attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNotLessCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -420,8 +405,6 @@
        */
       public void addGreaterOrEqualThanField(String attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(FieldCriteria.buildNotLessCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(FieldCriteria.buildNotLessCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -434,8 +417,6 @@
        */
       public void addLessOrEqualThan(Object attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildNotGreaterCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNotGreaterCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -448,8 +429,6 @@
        */
       public void addLessOrEqualThanField(String attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(FieldCriteria.buildNotGreaterCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(FieldCriteria.buildNotGreaterCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -463,8 +442,6 @@
        */
       public void addLike(Object attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildLikeCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildLikeCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -478,8 +455,6 @@
        */
       public void addNotLike(String attribute, Object value)
       {
  -		// PAW 
  -		// addSelectionCriteria(ValueCriteria.buildNotLikeCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNotLikeCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -492,8 +467,6 @@
        */
       public void addNotEqualTo(Object attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildNotEqualToCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNotEqualToCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -506,8 +479,6 @@
        */
       public void addGreaterThan(Object attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildGreaterCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildGreaterCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -520,8 +491,6 @@
        */
       public void addGreaterThanField(String attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(FieldCriteria.buildGreaterCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(FieldCriteria.buildGreaterCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -534,8 +503,6 @@
        */
       public void addLessThan(Object attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildLessCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildLessCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -548,8 +515,6 @@
        */
       public void addLessThanField(String attribute, Object value)
       {
  -		// PAW
  -		// addSelectionCriteria(FieldCriteria.buildLessCriteria(attribute, value, getAlias()));
   		addSelectionCriteria(FieldCriteria.buildLessCriteria(attribute, value, getUserAlias(attribute)));
       }
   
  @@ -674,8 +639,6 @@
        */
       public void addIsNull(String attribute)
       {
  -		// PAW
  -		//addSelectionCriteria(ValueCriteria.buildNullCriteria(attribute, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNullCriteria(attribute, getUserAlias(attribute)));
       }
   
  @@ -688,8 +651,6 @@
        */
       public void addColumnIsNull(String column)
       {
  -		// PAW
  -		//SelectionCriteria c = ValueCriteria.buildNullCriteria(column, getAlias());
   		SelectionCriteria c = ValueCriteria.buildNullCriteria(column, getUserAlias(column));
           c.setTranslateAttribute(false);
           addSelectionCriteria(c);
  @@ -703,8 +664,6 @@
        */
       public void addNotNull(String attribute)
       {
  -		// PAW
  -		//addSelectionCriteria(ValueCriteria.buildNotNullCriteria(attribute, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNotNullCriteria(attribute, getUserAlias(attribute)));
       }
   
  @@ -717,8 +676,6 @@
        */
       public void addColumnNotNull(String column)
       {
  -		// PAW
  -		// SelectionCriteria c = ValueCriteria.buildNotNullCriteria(column, getAlias());
   		SelectionCriteria c = ValueCriteria.buildNotNullCriteria(column, getUserAlias(column));
           c.setTranslateAttribute(false);
           addSelectionCriteria(c);
  @@ -734,8 +691,6 @@
        */
       public void addBetween(Object attribute, Object value1, Object value2)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildBeweenCriteria(attribute, value1, value2,
getAlias()));
   		addSelectionCriteria(ValueCriteria.buildBeweenCriteria(attribute, value1, value2, getUserAlias(attribute)));
       }
   
  @@ -749,8 +704,6 @@
        */
       public void addNotBetween(Object attribute, Object value1, Object value2)
       {
  -        // PAW
  -		// addSelectionCriteria(ValueCriteria.buildNotBeweenCriteria(attribute, value1, value2,
getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNotBeweenCriteria(attribute, value1, value2,
getUserAlias(attribute)));
       }
   
  @@ -842,8 +795,6 @@
        */
       public void addIn(Object attribute, Query subQuery)
       {
  -        // PAW
  -		// addSelectionCriteria(ValueCriteria.buildInCriteria(attribute, subQuery, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildInCriteria(attribute, subQuery, getUserAlias(attribute)));
       }
   
  @@ -854,8 +805,6 @@
        */
       public void addNotIn(String attribute, Query subQuery)
       {
  -		// PAW
  -		// addSelectionCriteria(ValueCriteria.buildNotInCriteria(attribute, subQuery, getAlias()));
   		addSelectionCriteria(ValueCriteria.buildNotInCriteria(attribute, subQuery, getUserAlias(attribute)));
       }
   
  @@ -1042,13 +991,11 @@
   	/**
   	 * @return String
   	 */
  -	// PAW
   	public UserAlias getUserAlias()
   	{
   		return m_userAlias;
   	}
  -	
  -	// PAW
  +
   	/**
   	 * Retrieves or if necessary, creates a user alias to be used
   	 * by a child criteria 
  @@ -1102,7 +1049,6 @@
   		}
   	}
   
  -	// PAW
   	/**
   	 * Sets the alias. Empty String is regarded as null.
   	 * @param alias The alias to set
  @@ -1130,7 +1076,6 @@
   		}
   	}
   
  -	// PAW
   	/**
   	 * Sets the alias using a userAlias object. 
   	 * @param userAlias The alias to set
  @@ -1222,7 +1167,6 @@
           m_negative = negative;
       }
   
  -	// PAW    
   	/**
   	 * Add a hint Class for a path. Used for relationships to extents.<br>
   	 * SqlStatment will use these hint classes when resolving the path.
  @@ -1313,6 +1257,5 @@
   		}
   	}
   
  -	
   
   }
  
  
  
  1.18      +22 -110   db-ojb/src/java/org/apache/ojb/broker/query/QueryFactory.java
  
  Index: QueryFactory.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/QueryFactory.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- QueryFactory.java	19 Jun 2004 09:21:37 -0000	1.17
  +++ QueryFactory.java	13 Jul 2004 11:37:57 -0000	1.18
  @@ -15,27 +15,15 @@
    * limitations under the License.
    */
   
  -import java.util.Collection;
  -import java.util.HashSet;
  -import java.util.Vector;
  -
  -import org.apache.ojb.broker.metadata.ClassDescriptor;
  -import org.apache.ojb.broker.metadata.DescriptorRepository;
  -import org.apache.ojb.broker.metadata.FieldDescriptor;
  -import org.apache.ojb.broker.metadata.MetadataManager;
   
   /**
  - * Insert the type's description here.
  + * Factory to create Queries.
    * @author <a href="mailto:thma@apache.org">Thomas Mahler<a>
  + * @author <a href="mailto:jbraeuchi@gmx.ch">Jakob Braeuchi<a>
    * @version $Id$
    */
   public final class QueryFactory
   {
  -    private static DescriptorRepository getRepository()
  -    {
  -        return MetadataManager.getInstance().getRepository();
  -    }
  -
       /**
        * create a new ReportQueryByCriteria
        * @param classToSearchFrom
  @@ -45,7 +33,6 @@
        */
       public static ReportQueryByCriteria newReportQuery(Class classToSearchFrom, String[]
columns, Criteria criteria, boolean distinct)
       {
  -        criteria = addCriteriaForOjbConcreteClasses(getRepository().getDescriptorFor(classToSearchFrom),
criteria);
           return new ReportQueryByCriteria(classToSearchFrom, columns, criteria, distinct);
       }
   
  @@ -58,7 +45,6 @@
        */
       public static ReportQueryByCriteria newReportQuery(Class classToSearchFrom, Criteria
criteria, boolean distinct)
       {
  -        criteria = addCriteriaForOjbConcreteClasses(getRepository().getDescriptorFor(classToSearchFrom),
criteria);
           return newReportQuery(classToSearchFrom, null, criteria, distinct);
       }
   
  @@ -74,7 +60,7 @@
       }
   
       /**
  -     * Method declaration
  +     * create a new QueryByCriteria
        * @param classToSearchFrom
        * @param criteria
        * @param distinct
  @@ -82,12 +68,11 @@
        */
       public static QueryByCriteria newQuery(Class classToSearchFrom, Criteria criteria,
boolean distinct)
       {
  -        criteria = addCriteriaForOjbConcreteClasses(getRepository().getDescriptorFor(classToSearchFrom),
criteria);
           return new QueryByCriteria(classToSearchFrom, criteria, distinct);
       }
   
       /**
  -     * Method declaration
  +     * create a new QueryByCriteria
        * @param classToSearchFrom
        * @param criteria
        * @return QueryByCriteria
  @@ -129,6 +114,7 @@
       }
   
       /**
  +     * create a new QueryByMtoNCriteria
        * @param classToSearchFrom
        * @param indirectionTable
        * @param criteria
  @@ -137,11 +123,11 @@
        */
       public static QueryByMtoNCriteria newQuery(Class classToSearchFrom, String indirectionTable,
Criteria criteria, boolean distinct)
       {
  -        criteria = addCriteriaForOjbConcreteClasses(getRepository().getDescriptorFor(classToSearchFrom),
criteria);
           return new QueryByMtoNCriteria(classToSearchFrom, indirectionTable, criteria, distinct);
       }
   
       /**
  +     * create a new QueryByCriteria
        * @param classToSearchFrom
        * @param indirectionTable
        * @param criteria
  @@ -149,7 +135,6 @@
        */
       public static QueryByCriteria newQuery(Class classToSearchFrom, String indirectionTable,
Criteria criteria)
       {
  -        criteria = addCriteriaForOjbConcreteClasses(getRepository().getDescriptorFor(classToSearchFrom),
criteria);
           return new QueryByMtoNCriteria(classToSearchFrom, indirectionTable, criteria);
       }
   
  @@ -165,101 +150,28 @@
       }
   
       /**
  -     * Searches the class descriptor for the ojbConcrete class attribute
  -     * if it finds the concrete class attribute, append a where clause which
  -     * specifies we can load all classes that are this type or extents of this type.
  -     * @param cld
  -     * @return the extent classes
  -     */
  -    private static Collection getExtentClasses(ClassDescriptor cld)
  -    {
  -        /**
  -         * 1. check if this class has a ojbConcreteClass attribute
  -         */
  -        FieldDescriptor fd = cld.getFieldDescriptorByName(ClassDescriptor.OJB_CONCRETE_CLASS);
  -        Collection classes = new HashSet();  // use same class only once
  -        if (fd != null)
  -        {
  -            classes.add(cld.getClassOfObject().getName());
  -        }
  -
  -        /**
  -         * 2. if this class has extents/is an extent search for all extents
  -         */
  -        if (cld.isExtent())
  +     * Return a copy of a QueryByCriteria
  +     * @param QueryByCriteria
  +     * @return QueryByCriteria
  +     */
  +    public static QueryByCriteria copyQuery(QueryByCriteria aQuery)
  +    {
  +        if (aQuery instanceof ReportQueryByMtoNCriteria)
           {
  -            Vector extentClasses = cld.getExtentClasses();
  -
  -            /**
  -             * 3. get all extents for this class
  -             */
  -            for (int i = 0; i < extentClasses.size(); i++)
  -            {
  -                Class ec = (Class) extentClasses.get(i);
  -                ClassDescriptor extCld = cld.getRepository().getDescriptorFor(ec);
  -                classes.addAll(getExtentClasses(extCld));
  -            }
  +            return new ReportQueryByMtoNCriteria((ReportQueryByMtoNCriteria)aQuery);
           }
  -
  -        return classes;
  -    }
  -
  -    /**
  -     * Searches the class descriptor for the ojbConcrete class attribute
  -     * if it finds the concrete class attribute, append a where clause which
  -     * specifies we can load all classes that are this type or extents of this type.
  -     * @param cld
  -     * @param crit
  -     * @return the passed in Criteria object + optionally and'ed criteria with OR'd class
  -     * type discriminators.
  -     */
  -    private static Criteria addCriteriaForOjbConcreteClasses(ClassDescriptor cld, Criteria
crit)
  -    {
  -        /**
  -         * 1. check if this class has a ojbConcreteClass attribute
  -         */
  -        Criteria concreteClassDiscriminator = null;
  -        Collection classes = getExtentClasses(cld);
  -
  -        /**
  -         * 1. create a new Criteria for objConcreteClass
  -         */
  -        if (!classes.isEmpty())
  +        
  +        if (aQuery instanceof ReportQueryByCriteria)
           {
  -            concreteClassDiscriminator = new Criteria();
  -            if (classes.size() > 1)
  -            {
  -                concreteClassDiscriminator = new Criteria();
  -                concreteClassDiscriminator.addIn(ClassDescriptor.OJB_CONCRETE_CLASS, classes);
  -            }
  -            else
  -            {
  -                concreteClassDiscriminator.addEqualTo(ClassDescriptor.OJB_CONCRETE_CLASS,
classes.toArray()[0]);
  -            }
  +            return new ReportQueryByCriteria((ReportQueryByCriteria)aQuery);
           }
   
  -        /**
  -         * 2. only add the AND (objConcreteClass = "some.class" OR....) if we've actually
found concrete
  -         * classes.
  -         */
  -        if (concreteClassDiscriminator != null)
  +        if (aQuery instanceof QueryByMtoNCriteria)
           {
  -            /**
  -             * it's possible there is no criteria attached to the query, and in this
  -             * case we still have to add the IN/EqualTo criteria for the concrete class
type
  -             * so check if the crit is null and then create a blank one if needed.
  -             */
  -            if (crit == null)
  -            {
  -                crit = new Criteria();
  -            }
  - 
  -            crit.addAndCriteria(concreteClassDiscriminator);
  +            return new QueryByMtoNCriteria((QueryByMtoNCriteria)aQuery);
           }
  -        /**
  -         * will just return the passed in criteria if no OJB concrete class is attribute
is found.
  -         */
  -        return crit;
  +        
  +        return new QueryByCriteria(aQuery);
       }
   
   }
  
  
  
  1.11      +14 -1     db-ojb/src/java/org/apache/ojb/broker/query/ReportQueryByCriteria.java
  
  Index: ReportQueryByCriteria.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/query/ReportQueryByCriteria.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ReportQueryByCriteria.java	9 Jun 2004 20:00:44 -0000	1.10
  +++ ReportQueryByCriteria.java	13 Jul 2004 11:37:57 -0000	1.11
  @@ -80,6 +80,19 @@
   	}
   
   	/**
  +     * Copy Constructor
  +     * @param aQuery
  +     */
  +    public ReportQueryByCriteria(ReportQueryByCriteria aQuery)
  +    {
  +        super(aQuery);
  +        
  +        m_attributes = aQuery.m_attributes;
  +        m_jdbcTypes = aQuery.m_jdbcTypes;
  +        m_joinAttributes = aQuery.m_joinAttributes;
  +    }
  +
  +	/**
   	 * Gets the columns.
   	 * @return Returns a String[]
        * @deprecated use getAttributes()
  
  
  
  1.86      +16 -26    db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java
  
  Index: PersistenceBrokerImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/core/PersistenceBrokerImpl.java,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- PersistenceBrokerImpl.java	6 Jul 2004 10:01:02 -0000	1.85
  +++ PersistenceBrokerImpl.java	13 Jul 2004 11:37:57 -0000	1.86
  @@ -15,6 +15,7 @@
    * limitations under the License.
    */
   
  +import java.util.ArrayList;
   import java.util.Collection;
   import java.util.Collections;
   import java.util.Enumeration;
  @@ -24,6 +25,7 @@
   import java.util.Set;
   
   import org.apache.ojb.broker.Identity;
  +import org.apache.ojb.broker.IdentityFactory;
   import org.apache.ojb.broker.ManageableCollection;
   import org.apache.ojb.broker.MtoNImplementor;
   import org.apache.ojb.broker.PBKey;
  @@ -32,7 +34,6 @@
   import org.apache.ojb.broker.TransactionAbortedException;
   import org.apache.ojb.broker.TransactionInProgressException;
   import org.apache.ojb.broker.TransactionNotInProgressException;
  -import org.apache.ojb.broker.IdentityFactory;
   import org.apache.ojb.broker.accesslayer.ChainingIterator;
   import org.apache.ojb.broker.accesslayer.ConnectionManagerFactory;
   import org.apache.ojb.broker.accesslayer.ConnectionManagerIF;
  @@ -59,6 +60,7 @@
   import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
   import org.apache.ojb.broker.metadata.fieldaccess.PersistentField;
   import org.apache.ojb.broker.query.Query;
  +import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.broker.query.QueryByIdentity;
   import org.apache.ojb.broker.query.QueryBySQL;
   import org.apache.ojb.broker.util.BrokerHelper;
  @@ -1798,43 +1800,31 @@
               // no extents just use the plain vanilla RsIterator
               if(logger.isDebugEnabled()) logger.debug("Creating RsIterator for class ["+cld.getClassNameOfObject()+"]");
   
  -            return factory.createRsIterator(query, cld, this);
  +            Query theQuery = serviceBrokerHelper().setConcreteClassCriteria((QueryByCriteria)query,
cld);
  +            return factory.createRsIterator(theQuery, cld, this);
           }
   
           if(logger.isDebugEnabled()) logger.debug("Creating ChainingIterator for class ["+cld.getClassNameOfObject()+"]");
   
           ChainingIterator chainingIter = new ChainingIterator();
  -
  -        // BRJ: add base class iterator
  -        if (!cld.isInterface())
  -        {
  -            if(logger.isDebugEnabled()) logger.debug("Adding RsIterator for class ["+cld.getClassNameOfObject()+"]
to ChainingIterator");
  -
  -            chainingIter.addIterator(factory.createRsIterator(query, cld, this));
  -        }
  -
  -        Iterator extents = getDescriptorRepository().getAllConcreteSubclassDescriptors(cld).iterator();
  +        Collection cldInfos = serviceBrokerHelper().getExtentsDescriptors(cld);
  +        Iterator extents = cldInfos.iterator();
  +        
           while (extents.hasNext())
           {
  -            ClassDescriptor extCld = (ClassDescriptor) extents.next();
  -
  -            // read same table only once
  -            if (chainingIter.containsIteratorForTable(extCld.getFullTableName()))
  -            {
  -                if(logger.isDebugEnabled()) logger.debug("Skipping class ["+extCld.getClassNameOfObject()+"]");
  -            }
  -            else
  -            {
  -                if(logger.isDebugEnabled()) logger.debug("Adding RsIterator of class ["+extCld.getClassNameOfObject()+"]
to ChainingIterator");
  +            BrokerHelper.CldInfo cldInfo = (BrokerHelper.CldInfo) extents.next();
  +            Query theQuery = serviceBrokerHelper().setConcreteClassCriteria((QueryByCriteria)query,
cldInfo.concreteClasses);
  +            
  +            if(logger.isDebugEnabled()) logger.debug("Adding RsIterator of class ["+ cldInfo.cld.getClassNameOfObject()+"]
to ChainingIterator");
   
  -                // add the iterator to the chaining iterator.
  -                chainingIter.addIterator(factory.createRsIterator(query, extCld, this));
  -            }
  +            // add the iterator to the chaining iterator.
  +            chainingIter.addIterator(factory.createRsIterator(theQuery, cldInfo.cld, this));
           }
   
           return chainingIter;
       }
   
  +    
       /**
        * Get an extent aware Iterator based on the ReportQuery
        *
  
  
  
  1.58      +135 -1    db-ojb/src/java/org/apache/ojb/broker/util/BrokerHelper.java
  
  Index: BrokerHelper.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/BrokerHelper.java,v
  retrieving revision 1.57
  retrieving revision 1.58
  diff -u -r1.57 -r1.58
  --- BrokerHelper.java	25 Jun 2004 16:08:45 -0000	1.57
  +++ BrokerHelper.java	13 Jul 2004 11:37:57 -0000	1.58
  @@ -18,8 +18,11 @@
   import java.sql.PreparedStatement;
   import java.sql.ResultSet;
   import java.sql.SQLException;
  +import java.util.ArrayList;
   import java.util.Collection;
  +import java.util.HashMap;
   import java.util.Iterator;
  +import java.util.List;
   import java.util.Map;
   import java.util.StringTokenizer;
   import java.util.WeakHashMap;
  @@ -50,6 +53,7 @@
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.broker.query.QueryBySQL;
  +import org.apache.ojb.broker.query.QueryFactory;
   import org.apache.ojb.broker.query.ReportQueryByCriteria;
   import org.apache.ojb.broker.query.ReportQueryByMtoNCriteria;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  @@ -820,6 +824,47 @@
       }
   
       /**
  +     * Add a Criteria for Concrete Class to the copied Query
  +     * @param aQuery
  +     * @param aCld
  +     * @return
  +     */
  +    public Query setConcreteClassCriteria(QueryByCriteria aQuery, ClassDescriptor aCld)
  +    {
  +        Query result = aQuery;
  +        FieldDescriptor fd = aCld.getFieldDescriptorByName(ClassDescriptor.OJB_CONCRETE_CLASS);
  +        
  +        if (fd != null)
  +        {
  +            QueryByCriteria copyQuery = QueryFactory.copyQuery(aQuery);
  +            copyQuery.getCriteria().addEqualTo(ClassDescriptor.OJB_CONCRETE_CLASS, aCld.getClassNameOfObject());
  +            result = copyQuery;
  +        }
  +        
  +        return result;
  +    }
  +
  +    /**
  +     * Add a Criteria for Concrete Classes to the copied Query
  +     * @param aQuery
  +     * @param concreteClasses
  +     * @return
  +     */
  +    public Query setConcreteClassCriteria(QueryByCriteria aQuery, Collection concreteClasses)
  +    {
  +        Query result = aQuery;
  +        
  +        if (concreteClasses != null)
  +        {
  +            QueryByCriteria copyQuery = QueryFactory.copyQuery(aQuery);
  +            copyQuery.getCriteria().addIn(ClassDescriptor.OJB_CONCRETE_CLASS, concreteClasses);
  +            result = copyQuery;
  +        }
  +        
  +        return result;
  +    }
  +    
  +    /**
        * Answer the Iterator for Collection or Array.
        * @param collectionOrArray a none null object of type {@link java.util.Collection},
        * Array or {@link org.apache.ojb.broker.ManageableCollection}.
  @@ -847,4 +892,93 @@
           }
           return colIterator;
       }
  +
  +    /**
  +     * Holder for ClassDescriptor and it's concreteClasses 
  +     */
  +    public static class CldInfo
  +    {
  +        public ClassDescriptor cld;
  +        public Collection concreteClasses;
  +    }
  +
  +    /**
  +     * Return a Collection of CldInfos for ClassDescriptor.
  +     * For each Table a CldInfo is returned
  +     * @param aCld
  +     * @return
  +     */
  +    public Collection getExtentsDescriptors(ClassDescriptor aCld)
  +    {
  +        Collection extentClds = m_broker.getDescriptorRepository().getAllConcreteSubclassDescriptors(aCld);
  +        Collection allClds = new ArrayList(1 + extentClds.size());
  +
  +        if (!aCld.isInterface())
  +        {
  +            allClds.add(aCld);
  +        }
  +        allClds.addAll(extentClds);
  +
  +        return buildCldInfos(allClds);
  +    }
  +
  +    /**
  +     * Build a Collection of CldInfos 
  +     * containing the classDescriptor and a collection of concreteClasses.
  +     * @param classDescriptors
  +     * @return 
  +     */
  +    private Collection buildCldInfos(Collection classDescriptors)
  +    {
  +        Collection result = new ArrayList(classDescriptors.size());
  +        Iterator iter;
  +        Map tableMap = new HashMap(classDescriptors.size());
  +
  +        // build map of tables
  +        iter = classDescriptors.iterator();
  +        while (iter.hasNext())
  +        {
  +            ClassDescriptor cld = (ClassDescriptor) iter.next();
  +            String table = cld.getFullTableName();
  +
  +            List extentsForTable = (List) tableMap.get(table);
  +            if (extentsForTable == null)
  +            {
  +                extentsForTable = new ArrayList();
  +                tableMap.put(table, extentsForTable);
  +            }
  +            extentsForTable.add(cld);
  +        }
  +
  +        // build collection of cldInfos
  +        iter = classDescriptors.iterator();
  +        while (iter.hasNext())
  +        {
  +            ClassDescriptor cld = (ClassDescriptor) iter.next();
  +            List cldsOfTable = (List) tableMap.get(cld.getFullTableName());
  +
  +            if (cldsOfTable != null)
  +            {
  +                FieldDescriptor fd = cld.getFieldDescriptorByName(ClassDescriptor.OJB_CONCRETE_CLASS);
  +                CldInfo cldInfo = new CldInfo();
  +                cldInfo.cld = (ClassDescriptor) cldsOfTable.get(0);
  +
  +                if (fd != null)
  +                {
  +                    ArrayList concreteClasses = new ArrayList(cldsOfTable.size());
  +                    for (int i = 0; i < cldsOfTable.size(); i++)
  +                    {
  +                        concreteClasses.add(((ClassDescriptor) cldsOfTable.get(i)).getClassNameOfObject());
  +                    }
  +                    cldInfo.concreteClasses = concreteClasses;
  +                }
  +
  +                result.add(cldInfo);
  +                tableMap.remove(cld.getFullTableName()); // table done
  +            }
  +        }
  +
  +        return result;
  +    }
  +    
   }
  
  
  
  1.116     +102 -2    db-ojb/src/test/org/apache/ojb/repository_junit.xml
  
  Index: repository_junit.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository_junit.xml,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- repository_junit.xml	8 Jul 2004 00:47:04 -0000	1.115
  +++ repository_junit.xml	13 Jul 2004 11:37:57 -0000	1.116
  @@ -644,7 +644,107 @@
         />
      </class-descriptor>
   
  -    <!-- mappings for anonymous field testclasses-->
  +<!-- mixed maping -->
  +<!-- Definitions for extent org.apache.ojb.broker.ObjectRepository$ABE -->
  +   <class-descriptor class="org.apache.ojb.broker.ObjectRepository$ABE">
  +      <extent-class class-ref="org.apache.ojb.broker.ObjectRepository$A" />
  +      <extent-class class-ref="org.apache.ojb.broker.ObjectRepository$B" />
  +      <extent-class class-ref="org.apache.ojb.broker.ObjectRepository$E" />
  +   </class-descriptor>
  +
  +   <class-descriptor class="org.apache.ojb.broker.ObjectRepository$LMNO">
  +      <extent-class class-ref="org.apache.ojb.broker.ObjectRepository$L" />
  +      <extent-class class-ref="org.apache.ojb.broker.ObjectRepository$M" />
  +      <extent-class class-ref="org.apache.ojb.broker.ObjectRepository$N" />
  +   </class-descriptor>
  +
  + <class-descriptor
  +        class="org.apache.ojb.broker.ObjectRepository$L"
  +        table="L_TABLE">
  +
  +        <field-descriptor
  +            name="id"
  +            column="ID"
  +            jdbc-type="INTEGER"
  +            primarykey="true"
  +            autoincrement="true"
  +        />
  +
  +        <field-descriptor
  +            name="someValue"
  +            column="L_VALUE"
  +            jdbc-type="INTEGER"
  +        />
  + </class-descriptor>
  +
  + <class-descriptor
  +        class="org.apache.ojb.broker.ObjectRepository$M"
  +   	  table="AB_TABLE"
  +   >
  +      <field-descriptor
  +         name="id"
  +         column="ID"
  +         jdbc-type="INTEGER"
  +         primarykey="true"
  +         autoincrement="true"
  +      />
  +      <field-descriptor
  +         name="ojbConcreteClass"
  +         column="CLASS_NAME"
  +         jdbc-type="VARCHAR"
  +      />
  +      <field-descriptor
  +         name="someValue"
  +         column="VALUE_"
  +         jdbc-type="INTEGER"
  +      />
  + </class-descriptor>
  +
  + <class-descriptor
  +        class="org.apache.ojb.broker.ObjectRepository$N"
  +   	  table="AB_TABLE"
  +   >
  +      <extent-class class-ref="org.apache.ojb.broker.ObjectRepository$O" />
  +
  +      <field-descriptor
  +         name="id"
  +         column="ID"
  +         jdbc-type="INTEGER"
  +         primarykey="true"
  +         autoincrement="true"
  +      />
  +      <field-descriptor
  +         name="ojbConcreteClass"
  +         column="CLASS_NAME"
  +         jdbc-type="VARCHAR"
  +      />
  +      <field-descriptor
  +         name="someValue"
  +         column="VALUE_"
  +         jdbc-type="INTEGER"
  +      />
  + </class-descriptor>
  +
  + <class-descriptor
  +        class="org.apache.ojb.broker.ObjectRepository$O"
  +        table="O_TABLE">
  +
  +        <field-descriptor
  +            name="id"
  +            column="ID"
  +            jdbc-type="INTEGER"
  +            primarykey="true"
  +            autoincrement="true"
  +        />
  +
  +        <field-descriptor
  +            name="someValue"
  +            column="O_VALUE"
  +            jdbc-type="INTEGER"
  +        />
  + </class-descriptor>
  +
  +<!-- mappings for anonymous field testclasses-->
    <class-descriptor
           class="org.apache.ojb.broker.ObjectRepository$E"
           table="TABLE_E">
  
  
  

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