Re: Newbie needs help with OJB in Eclipse

2004-04-16 Thread Thomas Mahler
Hi Doug,

This seems like a problem with your build classpath settings in eclipse.
Try to load OJB from CVS HEAD with eclipse. In CVS we have the eclipse 
.project and .claspath files that eclipse needs to build OJB.

Thomas

Doug Poland wrote:
Hello,

I'm trying to learn OJB but am struggling getting a simple project to
run in Eclipse 2.1.3.  I found what appears to be a good tutorial
entitled...
"Object-Relational Mapping with Apache Jakarta OJB" by Charles Chan
(http://www.onjava.com/lpt/a/2946) dated: 01/08/2003
I've built the clases and the project compiles.  The error I cannot get
past is... 

Property for key 'PersistenceBrokerFactoryClass' can not be found in
properties file.
As an FYI, I've successfully built the OJB rc6 from source.  I can also
run the tuturial shell scripts in bin.
Here's how my Eclipse project is layed out...

./.classpath
./.project
./OJB.properties
./build.properties
./repository.dtd
./repository.xml
./repository_internal.xml
./repository_user.xml
./com/omni/doug/ojb/lib/ant.jar
./com/omni/doug/ojb/lib/antlr.debug.jar
./com/omni/doug/ojb/lib/antlr.jar
./com/omni/doug/ojb/lib/antlr_compiletime.jar
./com/omni/doug/ojb/lib/commons-beanutils.jar
./com/omni/doug/ojb/lib/commons-collections.jar
./com/omni/doug/ojb/lib/commons-dbcp-1.1.jar
./com/omni/doug/ojb/lib/commons-lang-2.0.jar
./com/omni/doug/ojb/lib/commons-logging.jar
./com/omni/doug/ojb/lib/commons-pool-1.1.jar
./com/omni/doug/ojb/lib/db-ojb-1.0.rc6.jar
./com/omni/doug/ojb/lib/hsqldb.jar
./com/omni/doug/ojb/lib/j2ee.jar
./com/omni/doug/ojb/lib/jakarta-regexp-1.3.jar
./com/omni/doug/ojb/lib/jcs.jar
./com/omni/doug/ojb/lib/jdo.jar
./com/omni/doug/ojb/lib/junit.jar
./com/omni/doug/ojb/lib/log4j-1.2.8.jar
./com/omni/doug/ojb/lib/mysql-connector-java-3.0.7-stable-bin.jar
./com/omni/doug/ojb/lib/optional.jar
./com/omni/doug/ojb/lib/p6spy.jar
./com/omni/doug/ojb/lib/prevayler.jar
./com/omni/doug/ojb/lib/torque-3.0.2.jar
./com/omni/doug/ojb/lib/velocity-1.3.1.jar
./com/omni/doug/ojb/lib/xalan.jar
./com/omni/doug/ojb/lib/xdoclet-1.2b3-dev.jar
./com/omni/doug/ojb/lib/xdoclet-ojb-module-1.2b3-dev.jar
./com/omni/doug/ojb/lib/xercesImpl.jar
./com/omni/doug/ojb/lib/xjavadoc-1.0.jar
./com/omni/doug/ojb/lib/xml-apis.jar
./com/omni/doug/ojb/onlamp/BasePersistenceObjectImpl.class
./com/omni/doug/ojb/onlamp/BasePersistenceObjectImpl.java
./com/omni/doug/ojb/onlamp/Employee.class
./com/omni/doug/ojb/onlamp/Employee.java
./com/omni/doug/ojb/onlamp/EmployeeImpl.class
./com/omni/doug/ojb/onlamp/EmployeeImpl.java
./com/omni/doug/ojb/onlamp/EmployeeTest.class
./com/omni/doug/ojb/onlamp/EmployeeTest.java
./com/omni/doug/ojb/onlamp/Manager.class
./com/omni/doug/ojb/onlamp/Manager.java
./com/omni/doug/ojb/onlamp/ManagerImpl.class
./com/omni/doug/ojb/onlamp/ManagerImpl.java
./com/omni/doug/ojb/onlamp/OJBPersistenceManager.class
./com/omni/doug/ojb/onlamp/OJBPersistenceManager.java
./com/omni/doug/ojb/onlamp/OJBTransaction.class
./com/omni/doug/ojb/onlamp/OJBTransaction.java
./com/omni/doug/ojb/onlamp/PersistenceManager.class
./com/omni/doug/ojb/onlamp/PersistenceManager.java
./com/omni/doug/ojb/onlamp/Transaction.class
./com/omni/doug/ojb/onlamp/Transaction.java
If it helps, here's the console output from a debug session... 
[BOOT] WARN: Value "ojb.broker.cache.ObjectCacheDefaultImpl" is illegal for key "ObjectCacheClass" (should be a class, using default value class org.apache.ojb.broker.cache.ObjectCacheDefaultImpl)
[BOOT] WARN: Value "ojb.broker.accesslayer.ConnectionFactoryDefaultImpl" is illegal for key "ConnectionFactoryClass" (should be a class, using default value class org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl)
[BOOT] WARN: Value "ojb.odmg.locking.LockManagerDefaultImpl" is illegal for key "LockManagerClass" (should be a class, using default value class org.apache.ojb.odmg.locking.LockManagerDefaultImpl)
[BOOT] WARN: Value "ojb.odmg.locking.InMemoryLockMapImpl" is illegal for key "LockMapClass" (should be a class, using default value class org.apache.ojb.odmg.locking.InMemoryLockMapImpl)
[BOOT] WARN: Value "ojb.broker.util.logging.PoorMansLoggerImpl" is illegal for key "LoggerClass" (should be a class, using default value class org.apache.ojb.broker.util.logging.PoorMansLoggerImpl)
[BOOT] WARN: Value "ojb.broker.metadata.PersistentFieldPropertyImpl" is illegal for key "PersistentFieldClass" (should be a class, using default value class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImpl)
[BOOT] WARN: Value "ojb.broker.singlevm.PersistenceBrokerImpl" is illegal for key "PersistenceBrokerClass" (should be a class, using default value class org.apache.ojb.broker.core.PersistenceBrokerImpl)
[BOOT] WARN: Value "ojb.odmg.collections.DListImpl" is illegal for key "OqlCollectionClass" (should be a class, using default value class org.apache.ojb.odmg.collections.DListImpl)
[BOOT] WARN: Value "ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl" is illegal for key "PersistenceBrok

Re: Newbie needs help with OJB in Eclipse

2004-04-14 Thread Armin Waibel
Hi Doug,

seems like a classloader problem. Do you have different ojb-jar files 
(or source/classes + ojb-jar) in classpath?

regards,
Armin
Doug Poland wrote:

Hello,

I'm trying to learn OJB but am struggling getting a simple project to
run in Eclipse 2.1.3.  I found what appears to be a good tutorial
entitled...
"Object-Relational Mapping with Apache Jakarta OJB" by Charles Chan
(http://www.onjava.com/lpt/a/2946) dated: 01/08/2003
I've built the clases and the project compiles.  The error I cannot get
past is... 

Property for key 'PersistenceBrokerFactoryClass' can not be found in
properties file.
As an FYI, I've successfully built the OJB rc6 from source.  I can also
run the tuturial shell scripts in bin.
Here's how my Eclipse project is layed out...

./.classpath
./.project
./OJB.properties
./build.properties
./repository.dtd
./repository.xml
./repository_internal.xml
./repository_user.xml
./com/omni/doug/ojb/lib/ant.jar
./com/omni/doug/ojb/lib/antlr.debug.jar
./com/omni/doug/ojb/lib/antlr.jar
./com/omni/doug/ojb/lib/antlr_compiletime.jar
./com/omni/doug/ojb/lib/commons-beanutils.jar
./com/omni/doug/ojb/lib/commons-collections.jar
./com/omni/doug/ojb/lib/commons-dbcp-1.1.jar
./com/omni/doug/ojb/lib/commons-lang-2.0.jar
./com/omni/doug/ojb/lib/commons-logging.jar
./com/omni/doug/ojb/lib/commons-pool-1.1.jar
./com/omni/doug/ojb/lib/db-ojb-1.0.rc6.jar
./com/omni/doug/ojb/lib/hsqldb.jar
./com/omni/doug/ojb/lib/j2ee.jar
./com/omni/doug/ojb/lib/jakarta-regexp-1.3.jar
./com/omni/doug/ojb/lib/jcs.jar
./com/omni/doug/ojb/lib/jdo.jar
./com/omni/doug/ojb/lib/junit.jar
./com/omni/doug/ojb/lib/log4j-1.2.8.jar
./com/omni/doug/ojb/lib/mysql-connector-java-3.0.7-stable-bin.jar
./com/omni/doug/ojb/lib/optional.jar
./com/omni/doug/ojb/lib/p6spy.jar
./com/omni/doug/ojb/lib/prevayler.jar
./com/omni/doug/ojb/lib/torque-3.0.2.jar
./com/omni/doug/ojb/lib/velocity-1.3.1.jar
./com/omni/doug/ojb/lib/xalan.jar
./com/omni/doug/ojb/lib/xdoclet-1.2b3-dev.jar
./com/omni/doug/ojb/lib/xdoclet-ojb-module-1.2b3-dev.jar
./com/omni/doug/ojb/lib/xercesImpl.jar
./com/omni/doug/ojb/lib/xjavadoc-1.0.jar
./com/omni/doug/ojb/lib/xml-apis.jar
./com/omni/doug/ojb/onlamp/BasePersistenceObjectImpl.class
./com/omni/doug/ojb/onlamp/BasePersistenceObjectImpl.java
./com/omni/doug/ojb/onlamp/Employee.class
./com/omni/doug/ojb/onlamp/Employee.java
./com/omni/doug/ojb/onlamp/EmployeeImpl.class
./com/omni/doug/ojb/onlamp/EmployeeImpl.java
./com/omni/doug/ojb/onlamp/EmployeeTest.class
./com/omni/doug/ojb/onlamp/EmployeeTest.java
./com/omni/doug/ojb/onlamp/Manager.class
./com/omni/doug/ojb/onlamp/Manager.java
./com/omni/doug/ojb/onlamp/ManagerImpl.class
./com/omni/doug/ojb/onlamp/ManagerImpl.java
./com/omni/doug/ojb/onlamp/OJBPersistenceManager.class
./com/omni/doug/ojb/onlamp/OJBPersistenceManager.java
./com/omni/doug/ojb/onlamp/OJBTransaction.class
./com/omni/doug/ojb/onlamp/OJBTransaction.java
./com/omni/doug/ojb/onlamp/PersistenceManager.class
./com/omni/doug/ojb/onlamp/PersistenceManager.java
./com/omni/doug/ojb/onlamp/Transaction.class
./com/omni/doug/ojb/onlamp/Transaction.java
If it helps, here's the console output from a debug session... 
[BOOT] WARN: Value "ojb.broker.cache.ObjectCacheDefaultImpl" is illegal for key "ObjectCacheClass" (should be a class, using default value class org.apache.ojb.broker.cache.ObjectCacheDefaultImpl)
[BOOT] WARN: Value "ojb.broker.accesslayer.ConnectionFactoryDefaultImpl" is illegal for key "ConnectionFactoryClass" (should be a class, using default value class org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl)
[BOOT] WARN: Value "ojb.odmg.locking.LockManagerDefaultImpl" is illegal for key "LockManagerClass" (should be a class, using default value class org.apache.ojb.odmg.locking.LockManagerDefaultImpl)
[BOOT] WARN: Value "ojb.odmg.locking.InMemoryLockMapImpl" is illegal for key "LockMapClass" (should be a class, using default value class org.apache.ojb.odmg.locking.InMemoryLockMapImpl)
[BOOT] WARN: Value "ojb.broker.util.logging.PoorMansLoggerImpl" is illegal for key "LoggerClass" (should be a class, using default value class org.apache.ojb.broker.util.logging.PoorMansLoggerImpl)
[BOOT] WARN: Value "ojb.broker.metadata.PersistentFieldPropertyImpl" is illegal for key "PersistentFieldClass" (should be a class, using default value class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImpl)
[BOOT] WARN: Value "ojb.broker.singlevm.PersistenceBrokerImpl" is illegal for key "PersistenceBrokerClass" (should be a class, using default value class org.apache.ojb.broker.core.PersistenceBrokerImpl)
[BOOT] WARN: Value "ojb.odmg.collections.DListImpl" is illegal for key "OqlCollectionClass" (should be a class, using default value class org.apache.ojb.odmg.collections.DListImpl)
[BOOT] WARN: Value "ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl" is illegal for key "PersistenceBrokerFactoryClass" (should be a class, using default value null)
[BOOT] ERROR: Creation

Newbie needs help with OJB in Eclipse

2004-04-13 Thread Doug Poland
Hello,

I'm trying to learn OJB but am struggling getting a simple project to
run in Eclipse 2.1.3.  I found what appears to be a good tutorial
entitled...

"Object-Relational Mapping with Apache Jakarta OJB" by Charles Chan
(http://www.onjava.com/lpt/a/2946) dated: 01/08/2003

I've built the clases and the project compiles.  The error I cannot get
past is... 

Property for key 'PersistenceBrokerFactoryClass' can not be found in
properties file.

As an FYI, I've successfully built the OJB rc6 from source.  I can also
run the tuturial shell scripts in bin.

Here's how my Eclipse project is layed out...

./.classpath
./.project
./OJB.properties
./build.properties
./repository.dtd
./repository.xml
./repository_internal.xml
./repository_user.xml
./com/omni/doug/ojb/lib/ant.jar
./com/omni/doug/ojb/lib/antlr.debug.jar
./com/omni/doug/ojb/lib/antlr.jar
./com/omni/doug/ojb/lib/antlr_compiletime.jar
./com/omni/doug/ojb/lib/commons-beanutils.jar
./com/omni/doug/ojb/lib/commons-collections.jar
./com/omni/doug/ojb/lib/commons-dbcp-1.1.jar
./com/omni/doug/ojb/lib/commons-lang-2.0.jar
./com/omni/doug/ojb/lib/commons-logging.jar
./com/omni/doug/ojb/lib/commons-pool-1.1.jar
./com/omni/doug/ojb/lib/db-ojb-1.0.rc6.jar
./com/omni/doug/ojb/lib/hsqldb.jar
./com/omni/doug/ojb/lib/j2ee.jar
./com/omni/doug/ojb/lib/jakarta-regexp-1.3.jar
./com/omni/doug/ojb/lib/jcs.jar
./com/omni/doug/ojb/lib/jdo.jar
./com/omni/doug/ojb/lib/junit.jar
./com/omni/doug/ojb/lib/log4j-1.2.8.jar
./com/omni/doug/ojb/lib/mysql-connector-java-3.0.7-stable-bin.jar
./com/omni/doug/ojb/lib/optional.jar
./com/omni/doug/ojb/lib/p6spy.jar
./com/omni/doug/ojb/lib/prevayler.jar
./com/omni/doug/ojb/lib/torque-3.0.2.jar
./com/omni/doug/ojb/lib/velocity-1.3.1.jar
./com/omni/doug/ojb/lib/xalan.jar
./com/omni/doug/ojb/lib/xdoclet-1.2b3-dev.jar
./com/omni/doug/ojb/lib/xdoclet-ojb-module-1.2b3-dev.jar
./com/omni/doug/ojb/lib/xercesImpl.jar
./com/omni/doug/ojb/lib/xjavadoc-1.0.jar
./com/omni/doug/ojb/lib/xml-apis.jar
./com/omni/doug/ojb/onlamp/BasePersistenceObjectImpl.class
./com/omni/doug/ojb/onlamp/BasePersistenceObjectImpl.java
./com/omni/doug/ojb/onlamp/Employee.class
./com/omni/doug/ojb/onlamp/Employee.java
./com/omni/doug/ojb/onlamp/EmployeeImpl.class
./com/omni/doug/ojb/onlamp/EmployeeImpl.java
./com/omni/doug/ojb/onlamp/EmployeeTest.class
./com/omni/doug/ojb/onlamp/EmployeeTest.java
./com/omni/doug/ojb/onlamp/Manager.class
./com/omni/doug/ojb/onlamp/Manager.java
./com/omni/doug/ojb/onlamp/ManagerImpl.class
./com/omni/doug/ojb/onlamp/ManagerImpl.java
./com/omni/doug/ojb/onlamp/OJBPersistenceManager.class
./com/omni/doug/ojb/onlamp/OJBPersistenceManager.java
./com/omni/doug/ojb/onlamp/OJBTransaction.class
./com/omni/doug/ojb/onlamp/OJBTransaction.java
./com/omni/doug/ojb/onlamp/PersistenceManager.class
./com/omni/doug/ojb/onlamp/PersistenceManager.java
./com/omni/doug/ojb/onlamp/Transaction.class
./com/omni/doug/ojb/onlamp/Transaction.java

If it helps, here's the console output from a debug session... 
[BOOT] WARN: Value "ojb.broker.cache.ObjectCacheDefaultImpl" is illegal for key 
"ObjectCacheClass" (should be a class, using default value class 
org.apache.ojb.broker.cache.ObjectCacheDefaultImpl)
[BOOT] WARN: Value "ojb.broker.accesslayer.ConnectionFactoryDefaultImpl" is illegal 
for key "ConnectionFactoryClass" (should be a class, using default value class 
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl)
[BOOT] WARN: Value "ojb.odmg.locking.LockManagerDefaultImpl" is illegal for key 
"LockManagerClass" (should be a class, using default value class 
org.apache.ojb.odmg.locking.LockManagerDefaultImpl)
[BOOT] WARN: Value "ojb.odmg.locking.InMemoryLockMapImpl" is illegal for key 
"LockMapClass" (should be a class, using default value class 
org.apache.ojb.odmg.locking.InMemoryLockMapImpl)
[BOOT] WARN: Value "ojb.broker.util.logging.PoorMansLoggerImpl" is illegal for key 
"LoggerClass" (should be a class, using default value class 
org.apache.ojb.broker.util.logging.PoorMansLoggerImpl)
[BOOT] WARN: Value "ojb.broker.metadata.PersistentFieldPropertyImpl" is illegal for 
key "PersistentFieldClass" (should be a class, using default value class 
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImpl)
[BOOT] WARN: Value "ojb.broker.singlevm.PersistenceBrokerImpl" is illegal for key 
"PersistenceBrokerClass" (should be a class, using default value class 
org.apache.ojb.broker.core.PersistenceBrokerImpl)
[BOOT] WARN: Value "ojb.odmg.collections.DListImpl" is illegal for key 
"OqlCollectionClass" (should be a class, using default value class 
org.apache.ojb.odmg.collections.DListImpl)
[BOOT] WARN: Value "ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl" is illegal for 
key "PersistenceBrokerFactoryClass" (should be a class, using default value null)
[BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get 
PBF class object
Exception in thread "main" java.lang.ExceptionInInitializer

Newbie needs help

2003-12-10 Thread Patrick Scheuerer
Hello everybody,

I just got started with OJB and i'm experiencing some problems. Here's the
scenario that i'm trying to get to work:

A DOCUMENT belongs to 1..n CATEGORY.
A DOCUMENT is relevant to 0..n PRODUCT_MODELs.
A DOCUMENT is written by 1..1 AUTHOR.
D DOCUMENT is described by 1..n KEYWORDs.

My first question is: since there are many-to-many relatioships between
DOCUMENT and CATEGORY and DOCUMENT and KEYWORDS there are two join tables
called DOCUMENT_CATEGORY and DOCUMENTS_KEYWORD. How does one handle join
tables needed by many-to-many in OJB?

All the data retrieved from the database (MySQL) should be wrapped in
ValueObject Classes.

Following is the repository_user.xml file that I'm using so far. Every time
I'm trying to save object to the datastore or try to retrieve them I get a
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException with the
following message: java.util.ArrayList not found in OJB Repository.

Somebody suggested yesterday to use a List instead of a Vector (I tried
Vectors first) but the result is the same.

I tips, hints, suggestions would be highly appreciated. TIA.

Patrick

<-- start of repository_user.xml -->
 

 

 

 
  
 
  
 
  
 
  

  





 




 
  
 
  
 
  

   

  

  

  

  


 




 













 

 
   
 
  
 


  

 
  

  





 
  


<-- end of repository_user.xml -->



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



Re: Newbie needs help

2003-12-10 Thread Jakob Braeuchi
hi patrick,

the collection-descriptor is wrong :





there's no 

gruss aus bern
jakob


Patrick Scheuerer wrote:

Hello everybody,

I just got started with OJB and i'm experiencing some problems. Here's the
scenario that i'm trying to get to work:
A DOCUMENT belongs to 1..n CATEGORY.
A DOCUMENT is relevant to 0..n PRODUCT_MODELs.
A DOCUMENT is written by 1..1 AUTHOR.
D DOCUMENT is described by 1..n KEYWORDs.
My first question is: since there are many-to-many relatioships between
DOCUMENT and CATEGORY and DOCUMENT and KEYWORDS there are two join tables
called DOCUMENT_CATEGORY and DOCUMENTS_KEYWORD. How does one handle join
tables needed by many-to-many in OJB?
All the data retrieved from the database (MySQL) should be wrapped in
ValueObject Classes.
Following is the repository_user.xml file that I'm using so far. Every time
I'm trying to save object to the datastore or try to retrieve them I get a
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException with the
following message: java.util.ArrayList not found in OJB Repository.
Somebody suggested yesterday to use a List instead of a Vector (I tried
Vectors first) but the result is the same.
I tips, hints, suggestions would be highly appreciated. TIA.

Patrick

<-- start of repository_user.xml -->
 

	
	  access="anonymous"/> 
	
	 
	
	 
	  
	 
	  
	 
	  
	 
	  
	
	  
	
class-ref="ch.ctc.suppport.CategoryVO" 
		  auto-retrieve="true">
		
	


 

	
	  access="anonymous"/>

	
	 
	  
	 
	  
	 
	  
	
	   
	
	  
	
	  
	
	  
	
	  
	
	
	
element-class-ref="ch.ctc.support.category.PalModelVO" 
		   auto-retrieve="true" 
		   auto-update="true" 
	
indirection-table="pal_relevancy"> 
		
		
	
	
	
	
element-class-ref="ch.ctc.support.category.KeywordVO" 
		   auto-retrieve="true" 
		   auto-update="true" 
	
indirection-table="document_keyword"> 
		
		
	
	
	
class-ref="ch.ctc.suppport.CategoryVO" 
		  auto-retrieve="true">
		
	
	
	
class-ref="ch.ctc.suppport.MemberVO" 
		  auto-retrieve="true">
		
	


 
	
	
	  access="anonymous"/> 
	   
	 
	  
	

	
	
	
	
	  access="anonymous"/> 
	  
	
	  
	

	

	
	
	  column="company_id" 
	  jdbc-type="BIGINT" 
	  primarykey="true" 
	  autoincrement="true"/> 
	  
	

<-- end of repository_user.xml -->



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


RE: Newbie needs help

2003-12-10 Thread Patrick Scheuerer
> -Original Message-

> your repository_xml says: indirection-table="document_keyword".
> typo? (missing 's');

This is not a typo. The table is called document_keyword.

> > handle join tables needed by many-to-many in OJB?
> 
> see  .../db-ojb/src/test/org/apache/ojb/repository_junit.xml
> usage of 'indirection-table', e.g. Person <-> Role

I checked usage of 'indirection-table' with the Person <-> Role mapping and
it seems to be exactly like I used it. I can't find any difference


> I suggest that you compare your classes with the ones in 
> OJB's junit tests.

Couldn't find any differences. In junit tests Collections are used. I also
use Collections. 

> If you do not find the error, please post also your pc 
> classes source code.

In the following I included the source for all my value objects. I removed
getter/setter methods. I didn't include the repository.xml again.


--
package ch.ctc.support.document;

import java.sql.Date;
import java.util.Collection;
import java.util.Vector;

import ch.ctc.support.common.ValueObject;
import ch.ctc.support.member.MemberVO;

public class DocumentVO extends ValueObject {

private Long documentId;
private String documentName;
private String documentDescription;
private String documentVersion;
private byte[] documentAbstract;
private Date creationDate;
private Collection palModels;
private Collection keywords;
private Collection category;
private MemberVO documentAuthor;

}

--

package ch.ctc.support.category;

import ch.ctc.support.common.ValueObject;

public class KeywordVO extends ValueObject {

private Long keywordId;
private String keywordName;
}

--

package ch.ctc.support.category;

import ch.ctc.support.common.ValueObject;

public class CategoryVO extends ValueObject {

private Long categoryId;
private String categoryName;
private String categoryDescription;

}

--

package ch.ctc.support.member;

import ch.ctc.support.common.ValueObject;

public class MemberVO extends ValueObject {

private Long memberId;
private String firstName;
private String lastName;
private String userName;
private String password;
private String email;
private String company;
private int accessLevel;
}

--

package ch.ctc.support.member;

import ch.ctc.support.common.ValueObject;

public class CompanyVO extends ValueObject {

private Long companyId;
private String companyName;
}

--
package ch.ctc.support.common;

import java.io.Serializable;

public abstract class ValueObject implements Serializable{

public ValueObject() {
}

}

--






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



RE: Newbie needs help

2003-12-10 Thread oliver . matz
Hello Patrick,

> -Original Message-
> From: Patrick Scheuerer [mailto:[EMAIL PROTECTED]

> My first question is: since there are many-to-many 
> relatioships between
> DOCUMENT and CATEGORY and DOCUMENT and KEYWORDS there are two 
> join tables
> called DOCUMENT_CATEGORY and DOCUMENTS_KEYWORD. How does one 

your repository_xml says: indirection-table="document_keyword".
typo? (missing 's');

> handle join tables needed by many-to-many in OJB?

see  .../db-ojb/src/test/org/apache/ojb/repository_junit.xml
usage of 'indirection-table', e.g. Person <-> Role

> far. Every time
> I'm trying to save object to the datastore or try to retrieve 
> them I get a
> org.apache.ojb.broker.metadata.ClassNotPersistenceCapableExcep
> tion with the
> following message: java.util.ArrayList not found in OJB Repository.

> Somebody suggested yesterday to use a List instead of a 
> Vector (I tried Vectors first) but the result is the same.

You mean that you declare the collection of type java.util.List
and OJB complains that java.util.ArrayList is not 
persistence-capable?  I do not believe that.

I suggest that you compare your classes with the ones in 
OJB's junit tests.

If you do not find the error, please post also your pc classes
source code.

Olli

-- 
  Oliver Matz
  ppi Media GmbH
  Deliusstraße 10
  D-24114 Kiel
  phone +49 (0) 43 1-53 53-422
  fax   +49 (0) 43 1-53 53-2 22
  email mailto:[EMAIL PROTECTED]
  web   www.ppi.de

Explore your printnet!

DRUPA 2004
Düsseldorf, Germany, 6 - 19 May 2004, Booth 6E62

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



Newbie needs help

2003-12-10 Thread Patrick Scheuerer
Hello everybody,

I just got started with OJB and i'm experiencing some problems. Here's the
scenario that i'm trying to get to work:

A DOCUMENT belongs to 1..n CATEGORY.
A DOCUMENT is relevant to 0..n PRODUCT_MODELs.
A DOCUMENT is written by 1..1 AUTHOR.
D DOCUMENT is described by 1..n KEYWORDs.

My first question is: since there are many-to-many relatioships between
DOCUMENT and CATEGORY and DOCUMENT and KEYWORDS there are two join tables
called DOCUMENT_CATEGORY and DOCUMENTS_KEYWORD. How does one handle join
tables needed by many-to-many in OJB?

All the data retrieved from the database (MySQL) should be wrapped in
ValueObject Classes.

Following is the repository_user.xml file that I'm using so far. Every time
I'm trying to save object to the datastore or try to retrieve them I get a
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException with the
following message: java.util.ArrayList not found in OJB Repository.

Somebody suggested yesterday to use a List instead of a Vector (I tried
Vectors first) but the result is the same.

I tips, hints, suggestions would be highly appreciated. TIA.

Patrick

<-- start of repository_user.xml -->
 

 

 

 
  
 
  
 
  
 
  

  





 




 
  
 
  
 
  

   

  

  

  

  


 




 













 

 
   
 
  



  

 
  

  





 
  


<-- end of repository_user.xml -->



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