OJB 1.0.1 mapping associations(1:1,1:n) not working with Oracle8

2004-11-14 Thread f.rub

Hi all,

I tried to port an application from mysql to oracle 8.
My problem is the same as described here:
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]msgId=1643290

Assigned to the mapping associations i.e. I get a null value because
the n-side objects (or single object for 1:1) are not materialized.

the answer was, that is was fixed with 1.0 rc6 and Oracle9

but with oracle 8 and 1.0.1 the problem still occurs.
(with mysql I also had no probs)

Is there any way to solve this problem?
I cannot switch to oracle 9, cause the app has to run on an existing DB
server with oracle 8.

Thanks for your answer!
Frank

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



Re: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Ilias Lazaridis
Ilias Lazaridis wrote:
Thomas Dudziak wrote:
[...]
If you just want to run something, then drop in the source files and do
I want to run and explore it.
ant build
ant setup-db
cd build/resources
java -classpath the;classpath whatever.you.main.class.is
ok, will try.
I've compiled the code within netbeans, but i'm not able to start within 
the IDE.

can you please give me the exact command line for the tutorial 1?
My project resides on:
J:\pj\ojbeval\ojb-blank\src\java\org\apache\ojb\tutorial1
java -classpath???
I the OJB-team actually intrested to increase the general usage of OJB?
?
I have some very simple suggestions, which need only a few days to 
implement.
.
--
http://lazaridis.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: ODMG - delete referenced objects.

2004-11-14 Thread Łukasz Korzybski
Dnia czwartek, 11 listopada 2004 13:49, Gerhard Grosse napisa:
 On Wed, 10 Nov 2004 21:26:22 +0100, Grzegorz Pypec [EMAIL PROTECTED]

 wrote:


 Instead of tx.checkpoint() you can use ((TransactionExt) tx).flush(),
 which flushes all SQL to the DB without commit.

 However, normally OJB does a pretty good job in ordering the SQL
 correctly. Could it be that you have some cyclic references in your
 object model (e.g. A-B and B-A)?

 Gerhard

I suppose that after invoking flush(), transaction holds db connection opened 
all the time so we can later rollback? 

From JavaDoc:

 Calling flush flushes persistent object modifications made within the ODMG 
transaction since the last checkpoint to the underlying database transaction

If so, it is not a good news :)

Is anyone has similar problem with deleting referenced objects? I have exactly 
the same problem as Grzegorz Pypec with ojb1.0.1 nad PostgreSQL 7.4 (jdbc 3.0 
drv).
I can't believe that such essential feature doesn't work.

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



Re: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Ilias Lazaridis
Ilias Lazaridis wrote:
Ilias Lazaridis wrote:
Thomas Dudziak wrote:
[...]
If you just want to run something, then drop in the source files and do
I want to run and explore it.
ant build
ant setup-db
cd build/resources
java -classpath the;classpath whatever.you.main.class.is
ok, will try.
I've compiled the code within netbeans, but i'm not able to start within 
the IDE.

can you please give me the exact command line for the tutorial 1?
My project resides on:
J:\pj\ojbeval\ojb-blank\src\java\org\apache\ojb\tutorial1
java -classpath???
update:
An ant target jar is available. Within Netbeans 4.0, i've started this.
Try to execute the produced jar:
J:\pj\ojbeval\ojb-blank\targetjava -jar my-project.jar
Failed to load Main-Class manifest attribute from
my-project.jar
I really think your quick-start application needs to be updated a 
little, thus it is easier for newcomers to understand.

I can assist you to make a netbeans 4.0 project and a very compact 
document, which will be usable for total newcomers.

[but first, please let me know how to start my OJB tutorials]
I the OJB-team actually intrested to increase the general usage of OJB?
?
I have some very simple suggestions, which need only a few days to 
implement.
.
.
--
http://lazaridis.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Jakob Braeuchi
hi ilias,
any help will be really appreciated. i do not know netbeans but i try to run the 
tutorial1.Application from within eclipse. as soon as i have it running i'll let 
you know.

jakob
Ilias Lazaridis schrieb:
Ilias Lazaridis wrote:
Ilias Lazaridis wrote:
Thomas Dudziak wrote:
[...]
If you just want to run something, then drop in the source files and do

I want to run and explore it.
ant build
ant setup-db
cd build/resources
java -classpath the;classpath whatever.you.main.class.is

ok, will try.

I've compiled the code within netbeans, but i'm not able to start 
within the IDE.

can you please give me the exact command line for the tutorial 1?
My project resides on:
J:\pj\ojbeval\ojb-blank\src\java\org\apache\ojb\tutorial1
java -classpath???

update:
An ant target jar is available. Within Netbeans 4.0, i've started this.
Try to execute the produced jar:
J:\pj\ojbeval\ojb-blank\targetjava -jar my-project.jar
Failed to load Main-Class manifest attribute from
my-project.jar
I really think your quick-start application needs to be updated a 
little, thus it is easier for newcomers to understand.

I can assist you to make a netbeans 4.0 project and a very compact 
document, which will be usable for total newcomers.

[but first, please let me know how to start my OJB tutorials]
I the OJB-team actually intrested to increase the general usage of OJB?

?
I have some very simple suggestions, which need only a few days to 
implement.

.

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


Re: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Ilias Lazaridis
Jakob Braeuchi wrote:
hi ilias,
any help will be really appreciated. 
ok, very nice.
i do not know netbeans but i try to 
run the tutorial1.Application from within eclipse. as soon as i have it 
running i'll let you know.
The command line parameters would fine (or even better), too!
I want to run and explore it.
ant build
ant setup-db
cd build/resources
java -classpath the;classpath whatever.you.main.class.is
[...]
can you please give me the exact command line for the tutorial 1?
My project resides on:
J:\pj\ojbeval\ojb-blank\src\java\org\apache\ojb\tutorial1
java -classpath???
[...]
Try to execute the produced jar:
J:\pj\ojbeval\ojb-blank\targetjava -jar my-project.jar
Failed to load Main-Class manifest attribute from
my-project.jar
.
--
http://lazaridis.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Thomas Dudziak
Ilias Lazaridis wrote:
Jakob Braeuchi wrote:
hi ilias,
any help will be really appreciated. 

ok, very nice.
i do not know netbeans but i try to run the tutorial1.Application from 
within eclipse. as soon as i have it running i'll let you know.

The command line parameters would fine (or even better), too!
Its all explained in the getting started guide:
After you executed 'ant build' and 'ant setup-db', you simply add all 
jars in the lib folder to your classpath as well as the compiled classes 
(build/java I believe), and the run your main class (depends on the 
tutorial) in the build/resources folder.
Btw, I don't know whether a netbeans project can include run 
configurations, Eclipse project files at least cannot include these.

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


Re: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Łukasz Korzybski
Dnia niedziela, 14 listopada 2004 21:29, Thomas Dudziak napisa:
 Ilias Lazaridis wrote:
  Jakob Braeuchi wrote:
  hi ilias,
 
  any help will be really appreciated.
 
  ok, very nice.
 
  i do not know netbeans but i try to run the tutorial1.Application from
  within eclipse. as soon as i have it running i'll let you know.
 
  The command line parameters would fine (or even better), too!

 Its all explained in the getting started guide:
 After you executed 'ant build' and 'ant setup-db', you simply add all
 jars in the lib folder to your classpath as well as the compiled classes
 (build/java I believe), and the run your main class (depends on the
 tutorial) in the build/resources folder.
 Btw, I don't know whether a netbeans project can include run
 configurations, Eclipse project files at least cannot include these.

NB 4.0 uses ant natively for its projects. To run obj-blank in NB:

New Project - Java Project with Existing Ant Script

We need to choose project location and select build.xml
After creation, in project properties we can select build, deploy etc. 
targets.

Open build.xml and add run target:

target name=run depends=compile description=Run a main class.
java classname=ojbtest.Main fork=true
arg line=${application.args}/
classpath refid=runtime-classpath/
/java
/target

And everything should fly.

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



Re: Simple Inheritance problem with multiple class to one table mapping

2004-11-14 Thread Thomas Dudziak
Sylvain Juge wrote:
the XDoclet output is the following
In fact now it doesn't process the Apartement.java file, and I don't know why 
because It used to process the file before. However, even if the file was 
processed by xdoclet, there was no result in the repository file, like now when 
it's not processed, that's why I found it weird.
[ojbdoclet] Type kdms.core.Room
[ojbdoclet] Type kdms.core.NetworkAddress
[ojbdoclet] Type kdms.core.AbstractRoom
[ojbdoclet] Processed 3 types
[ojbdoclet] Processed 3 types
Sylvain.
I tried your classes and they worked without problems with a normal OJB 
1.0.1 (I replaced the NetworkAddressVector with a List because I don't 
know about this class, and I added a dummy NetworkAddress as you didn't 
post it):

---
package kdms.core;
import java.util.List;
/**
 * @ojb.class generate-table-info=false
 * @ojb.field name=abstractroom_id
 *primarykey=true
 *autoincrement=database
 *jdbc-type=INTEGER
 */
public class AbstractRoom {
/** @ojb.field   length=50 */
protected String ojbConcreteClass;
/** @ojb.field name=number */
protected int number;
/** @ojb.field name=size */
protected float size;
/**
 * @ojb.collection  name=nAddresses
 *  element-class-ref=kdms.core.NetworkAddress
 *  foreignkey=abstractroom_id
 *  auto-update=true
 *  auto-retrieve=true
 *  auto-delete=false
 */
protected List nAddresses;
}
package kdms.core;
/**
 * @ojb.class table=abstract_rooms
 * @ojb.field name=apartment_id
 *jdbc-type=INTEGER
 * @ojb.index name=room_unique
 *unique=true
 *fields=number,apartment_id
 */
public class Room extends AbstractRoom {
/** @ojb.field name=capacity */
private int capacity;
}
package kdms.core;
/**
 * @ojb.class table=abstract_rooms
 * @ojb.field name=testField
 *jdbc-type=INTEGER
 */
public class Apartment extends AbstractRoom {}
package kdms.core;
/**
 * @ojb.class table=network_address
 * @ojb.field name=abstractroom_id
 *primarykey=true
 *autoincrement=database
 *jdbc-type=INTEGER
 */
public class NetworkAddress {}
---
[ojbdoclet] (XDocletMain.start   47  ) Running 
ojbrepository/
[ojbdoclet] Generating ojb repository descriptor 
(build/resources//repository_user.xml)
[ojbdoclet] Type kdms.core.Room
[ojbdoclet] Type kdms.core.NetworkAddress
[ojbdoclet] Type kdms.core.AbstractRoom
[ojbdoclet] Type kdms.core.Apartment
[ojbdoclet] Processed 4 types
[ojbdoclet] Processed 4 types
[ojbdoclet] (XDocletMain.start   47  ) Running 
torqueschema/
[ojbdoclet] Generating torque schema (build/resources//project-schema.xml)
[ojbdoclet] Processed 4 types

---
!-- file containing the repository descriptions for user-defined types --
!-- Generated by the xdoclet-ojb module --
class-descriptor
class=kdms.core.AbstractRoom

extent-class class-ref=kdms.core.Apartment/
extent-class class-ref=kdms.core.Room/
/class-descriptor
class-descriptor
class=kdms.core.Apartment
table=abstract_rooms

field-descriptor
name=abstractroom_id
column=abstractroom_id
jdbc-type=INTEGER
primarykey=true
autoincrement=true
access=anonymous

/field-descriptor
field-descriptor
name=ojbConcreteClass
column=ojbConcreteClass
jdbc-type=VARCHAR
length=50

/field-descriptor
field-descriptor
name=number
column=number
jdbc-type=INTEGER

/field-descriptor
field-descriptor
name=size
column=size
jdbc-type=REAL

/field-descriptor
field-descriptor
name=testField
column=testField
jdbc-type=INTEGER
access=anonymous

/field-descriptor
collection-descriptor
name=nAddresses
element-class-ref=kdms.core.NetworkAddress
auto-retrieve=true
auto-update=true
auto-delete=false

inverse-foreignkey field-ref=abstractroom_id/
/collection-descriptor
/class-descriptor
class-descriptor
class=kdms.core.NetworkAddress
table=network_address

field-descriptor
name=abstractroom_id
column=abstractroom_id
jdbc-type=INTEGER
primarykey=true
autoincrement=true
access=anonymous

/field-descriptor
/class-descriptor
class-descriptor
class=kdms.core.Room
table=abstract_rooms

field-descriptor
name=abstractroom_id
column=abstractroom_id
jdbc-type=INTEGER
primarykey=true
autoincrement=true
access=anonymous

/field-descriptor

Re: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Jakob Braeuchi
hi all,
i'm currently working on a new ant-target ojb-quickstart to make it really easy 
for beginners.

jakob
ukasz Korzybski schrieb:
Dnia niedziela, 14 listopada 2004 21:29, Thomas Dudziak napisa:
Ilias Lazaridis wrote:
Jakob Braeuchi wrote:
hi ilias,
any help will be really appreciated.
ok, very nice.

i do not know netbeans but i try to run the tutorial1.Application from
within eclipse. as soon as i have it running i'll let you know.
The command line parameters would fine (or even better), too!
Its all explained in the getting started guide:
After you executed 'ant build' and 'ant setup-db', you simply add all
jars in the lib folder to your classpath as well as the compiled classes
(build/java I believe), and the run your main class (depends on the
tutorial) in the build/resources folder.
Btw, I don't know whether a netbeans project can include run
configurations, Eclipse project files at least cannot include these.

NB 4.0 uses ant natively for its projects. To run obj-blank in NB:
New Project - Java Project with Existing Ant Script
We need to choose project location and select build.xml
After creation, in project properties we can select build, deploy etc. 
targets.

Open build.xml and add run target:
target name=run depends=compile description=Run a main class.
java classname=ojbtest.Main fork=true
arg line=${application.args}/
classpath refid=runtime-classpath/
/java
/target
And everything should fly.
-
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: [QUICKSTART] - A OJB quickstart similar to hibernate

2004-11-14 Thread Jakob Braeuchi
hi all,
i commited the new quick-start to 1.0.x branch.
please check it out !
jakob
Jakob Braeuchi schrieb:
hi all,
i'm currently working on a new ant-target ojb-quickstart to make it 
really easy for beginners.

jakob
ukasz Korzybski schrieb:
Dnia niedziela, 14 listopada 2004 21:29, Thomas Dudziak napisa:
Ilias Lazaridis wrote:
Jakob Braeuchi wrote:
hi ilias,
any help will be really appreciated.

ok, very nice.

i do not know netbeans but i try to run the tutorial1.Application from
within eclipse. as soon as i have it running i'll let you know.

The command line parameters would fine (or even better), too!

Its all explained in the getting started guide:
After you executed 'ant build' and 'ant setup-db', you simply add all
jars in the lib folder to your classpath as well as the compiled classes
(build/java I believe), and the run your main class (depends on the
tutorial) in the build/resources folder.
Btw, I don't know whether a netbeans project can include run
configurations, Eclipse project files at least cannot include these.

NB 4.0 uses ant natively for its projects. To run obj-blank in NB:
New Project - Java Project with Existing Ant Script
We need to choose project location and select build.xml
After creation, in project properties we can select build, deploy etc. 
targets.

Open build.xml and add run target:
target name=run depends=compile description=Run a main class.
java classname=ojbtest.Main fork=true
arg line=${application.args}/
classpath refid=runtime-classpath/
/java
/target
And everything should fly.
-
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]

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


Re: Re: Simple Inheritance problem with multiple class to one table mapping

2004-11-14 Thread Sylvain Juge
Hi,

Thank for your help, but I think I solved my problem.
I don't know what I was doing wrong, but simply by rewriting by hand the 
Apartment Class, I solved the problem.
Now I works really great, despite sometimes Eclipse seems to go a little crazy, 
so I think I also need to update it (ver 3.0.1).

Thx,
Sylvain.




Sylvain Juge wrote:

  the XDoclet output is the following
  In fact now it doesn't process the Apartement.java file, and I don't know 
 why because It used to process the file before. However, even if the file was 
 processed by xdoclet, there was no result in the repository file, like now 
 when it's not processed, that's why I found it weird.
  [ojbdoclet] Type kdms.core.Room
  [ojbdoclet] Type kdms.core.NetworkAddress
  [ojbdoclet] Type kdms.core.AbstractRoom
  [ojbdoclet] Processed 3 types
  [ojbdoclet] Processed 3 types
  Sylvain.

I tried your classes and they worked without problems with a normal OJB 
1.0.1 (I replaced the NetworkAddressVector with a List because I don't 
know about this class, and I added a dummy NetworkAddress as you didn't 
post it):

---

package kdms.core;

import java.util.List;

/**
  * @ojb.class generate-table-info=false
  * @ojb.field name=abstractroom_id
  *primarykey=true
  *autoincrement=database
  *jdbc-type=INTEGER
  */
public class AbstractRoom {
 /** @ojb.field   length=50 */
 protected String ojbConcreteClass;
 /** @ojb.field name=number */
 protected int number;
 /** @ojb.field name=size */
 protected float size;
 /**
  * @ojb.collection  name=nAddresses
  *  element-class-ref=kdms.core.NetworkAddress
  *  foreignkey=abstractroom_id
  *  auto-update=true
  *  auto-retrieve=true
  *  auto-delete=false
  */
 protected List nAddresses;
}


package kdms.core;

/**
  * @ojb.class table=abstract_rooms
  * @ojb.field name=apartment_id
  *jdbc-type=INTEGER
  * @ojb.index name=room_unique
  *unique=true
  *fields=number,apartment_id
  */
public class Room extends AbstractRoom {
 /** @ojb.field name=capacity */
 private int capacity;
}


package kdms.core;

/**
  * @ojb.class table=abstract_rooms
  * @ojb.field name=testField
  *jdbc-type=INTEGER
  */
public class Apartment extends AbstractRoom {}


package kdms.core;

/**
  * @ojb.class table=network_address
  * @ojb.field name=abstractroom_id
  *primarykey=true
  *autoincrement=database
  *jdbc-type=INTEGER
  */
public class NetworkAddress {}

---

[ojbdoclet] (XDocletMain.start   47  ) Running 
 ojbrepository/ 
[ojbdoclet] Generating ojb repository descriptor 
(build/resources//repository_user.xml)
[ojbdoclet] Type kdms.core.Room
[ojbdoclet] Type kdms.core.NetworkAddress
[ojbdoclet] Type kdms.core.AbstractRoom
[ojbdoclet] Type kdms.core.Apartment
[ojbdoclet] Processed 4 types
[ojbdoclet] Processed 4 types
[ojbdoclet] (XDocletMain.start   47  ) Running 
 torqueschema/ 
[ojbdoclet] Generating torque schema (build/resources//project-schema.xml)
[ojbdoclet] Processed 4 types

---

 !-- file containing the repository descriptions for user-defined types -- 
 !-- Generated by the xdoclet-ojb module -- 

 class-descriptor
 class=kdms.core.AbstractRoom
  
  extent-class class-ref=kdms.core.Apartment/ 
  extent-class class-ref=kdms.core.Room/ 
 /class-descriptor 
 class-descriptor
 class=kdms.core.Apartment
 table=abstract_rooms
  
  field-descriptor
 name=abstractroom_id
 column=abstractroom_id
 jdbc-type=INTEGER
 primarykey=true
 autoincrement=true
 access=anonymous
  
  /field-descriptor 
  field-descriptor
 name=ojbConcreteClass
 column=ojbConcreteClass
 jdbc-type=VARCHAR
 length=50
  
  /field-descriptor 
  field-descriptor
 name=number
 column=number
 jdbc-type=INTEGER
  
  /field-descriptor 
  field-descriptor
 name=size
 column=size
 jdbc-type=REAL
  
  /field-descriptor 
  field-descriptor
 name=testField
 column=testField
 jdbc-type=INTEGER
 access=anonymous
  
  /field-descriptor 
  collection-descriptor
 name=nAddresses
 element-class-ref=kdms.core.NetworkAddress
 auto-retrieve=true
 auto-update=true
 auto-delete=false
  
  inverse-foreignkey field-ref=abstractroom_id/ 
  /collection-descriptor 
 /class-descriptor 
 class-descriptor
 class=kdms.core.NetworkAddress
 table=network_address