Hi all,

        I am trying to run a ojb hello world but the method getObjectByIdentity doesnt 
work because the error happens:

org.apache.ojb.broker.PersistenceBrokerException: ConfigurableFactory configuration 
key class for key'StatementsForClassClass' does not exist.
 at org.apache.ojb.broker.util.factory.ConfigurableFactory.configure(Unknown Source)
 at org.apache.ojb.broker.util.configuration.impl.OjbConfigurator.configure(Unknown 
Source)
 at org.apache.ojb.broker.util.factory.ConfigurableFactory.<init>(Unknown Source)
 at org.apache.ojb.broker.accesslayer.StatementsForClassFactory.<init>(Unknown Source)
....       

hello world source
--------------------------------------------------------


PersistenceBroker broker = null;
try
{
 broker = PersistenceBrokerFactory.
    defaultPersistenceBroker();
 
 Application entity = new Application();
 entity.setId(new Integer(8));
 QueryByIdentity query = new QueryByIdentity(entity); 
 Object object = broker.getObjectByQuery(query);
 
 broker.close();       
}
catch (Throwable t)
{
 t.printStackTrace();
}



repository_user.xml
--------------------------------------------------------------


<class-descriptor
 class="test.Application"
 table="job_scheduler.application">
 <field-descriptor
  id="1"
  name="id"
  column="idt_application"
  jdbc-type="INTEGER"
  primarykey="true"
 />
 <field-descriptor
  id="2"
  name="name"
  column="nam_application"
  jdbc-type="VARCHAR"
 />
</class-descriptor>



Application class
--------------------------

package test;

public class Application
{
 private Integer id;
 private String name;

 public Integer getId()
 {
  return this.id;
 }

 public void setId(Integer id)
 {
  this.id = id;
 }

 public String getName()
 {
  return this.name;
 }

 public void setName(String name)
 {
  this.name = name;
 }
}

Regards,

Norival

Reply via email to