RE: nullable integer fields

2003-02-21 Thread David Mitchell
YES! Worked like a charm. Thank you very much! -Original Message- From: Thomas Mahler [mailto:[EMAIL PROTECTED] Sent: Friday, February 21, 2003 4:39 PM To: OJB Users List Subject: Re: nullable integer fields Hi David, You'll have to use the Int2IntegerFieldConversion on your Integer

Can't run Tutorial1 - Product not in OJB Repository?

2003-02-21 Thread Bill Bug
Hi All, I'm having trouble getting the tutorials running. I'm using my locally installed PostgreSQL v7.3 RDBMS and have changed the appropriate parameters: in build.properties profile=postgresql in profile/postgresql.profile # D A T A B A S E S

Re: nullable integer fields

2003-02-21 Thread Thomas Mahler
Hi David, You'll have to use the Int2IntegerFieldConversion on your Integer attribute. This will convert 0 into null on saving! Details on FieldConversions in jdbc-types.html cheers, Thomas David Mitchell wrote: I have a table with some foreign key columns defined as integer, nullable. Unfo

Re: nullable integer fields

2003-02-21 Thread Robert S. Sfeir
I always use Integer for everything that relates to int in my code. It works much much better and I don't have these problems. Also getting the intValue() of an Integer is very easy. On Friday, Feb 21, 2003, at 17:28 US/Eastern, David Mitchell wrote: I have a table with some foreign key colu

nullable integer fields

2003-02-21 Thread David Mitchell
I have a table with some foreign key columns defined as integer, nullable. Unfortunately, since OJB has mapped my integer columns to "int" values in Java, I have no way to set a null value on the field! In other words, I create a new instance of an object, I dont set a value for the null fiel

ojb v0.9.9 problem

2003-02-21 Thread Michael Duffy
I, too, experienced the same problem that Jemmee Yung and Ferran Parra did. Jemmee's solution, changing the jcd-alias in repository.xml to read "repository.xml" does indeed work. Thank you, Jemmee, for pushing my efforts forward. But personally I'm not satisfied with this. I'd like to know if t

Re: default behaviour odmg

2003-02-21 Thread Thomas Mahler
Hi Serge, Boulay, Serge wrote: > Could someone please let me know the default behaviour of odmg . > > If and I have an Order object with a collection of Order items and I > lock the order object > > tx.lock(Order, Transaction.WRITE); > > > does odmg api write the Order Items objects collection to

Re: Small Identity bug

2003-02-21 Thread Thomas Mahler
Hi Steve, Oops, you found a nasty beast! I just applied your patch to CVS, Thanks, Thomas sclark wrote: I have found a minor bug in Identity.equals(), which can result in a NPE. The line inside the pk loop should read: result = (pkValues[i] == null) ? (otherPkValues[i] == null) : pkValues[

Re: 1:M querys constraints

2003-02-21 Thread V.B. Skrypnyk
Hi Jacob, This seems to me to be an optimal solution. If I have the originator object, dynamic parameters are not an issue. --Bill. - Original Message - From: "Jakob Braeuchi" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 11:49 AM Subject:

inverse mapping multiple foreign keys?

2003-02-21 Thread Tim Drury
I have an object that has two foreign keys and is held in a List of one of its parent tables. Here is the example: (obviously this is pseudo code) class Invoice { Contact shipper; Contact buyer; List shipperNotes; // List of Note objects List buyerNotes;

Re: 1:M querys constraints

2003-02-21 Thread sclark
Jakob, You are correct; all of the logic is in the Builder class. As you say, there are lots of possibilities for these constraints. I think that the best way to express them is to use Java, rather than trying to invent some new syntax that fits inside of XML. And I bet that a fairly small set

Re: 1:M querys constraints

2003-02-21 Thread Jakob Braeuchi
hi bill, imo steve's proposal provides a lot more flexibility than mine. the query restrictor will only modify the foreignKeyQuery it will not build the whole query. so it needs the originator object and the foreignKeyQuery based on the collection-descriptor, and what it does with this quer

Re: 1:M querys constraints

2003-02-21 Thread Jakob Braeuchi
hi steve, what i miss in this approach is the operation (=, <>, like, between etc.) . as far as i understand your proposal, the operation and the whole logic is dependent of the query-builder. this makes it quite easy for us to implement it in ojb, but it moves the burden of implementation to

default behaviour odmg

2003-02-21 Thread Boulay, Serge
Could someone please let me know the default behaviour of odmg . If and I have an Order object with a collection of Order items and I lock the order object tx.lock(Order, Transaction.WRITE); does odmg api write the Order Items objects collection to the database or do you have to explict l

Re: 1:M querys constraints

2003-02-21 Thread V.B. Skrypnyk
Hi Steve, > It looks like you didn't send this to the list, only to me. Sorry, email client woes :(( > I wanted to clarify a couple of things, especially where you thought that my > approach would require extensive metadata mods. My intention is that the only > addition would be the element, w

Small Identity bug

2003-02-21 Thread sclark
I have found a minor bug in Identity.equals(), which can result in a NPE. The line inside the pk loop should read: result = (pkValues[i] == null) ? (otherPkValues[i] == null) : pkValues[i].equals(otherPkValues[i]); I'm not a committer, so I maybe somebody else can patch CVS. -steve Steve

Cache & 1:1

2003-02-21 Thread Andres Ferrando
Hi! Can I use a cache for "lazy loading" in a 1:1 relation? any example?? TIA! -- Andres Ferrando <[EMAIL PROTECTED]> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: 1:M querys constraints

2003-02-21 Thread sclark
Bill, It looks like you didn't send this to the list, only to me. I wanted to clarify a couple of things, especially where you thought that my approach would require extensive metadata mods. My intention is that the only addition would be the element, which has a 'class' attribute and then t

Re: 1:M querys constraints

2003-02-21 Thread V B Skrypnyk
Hi, I would agree with Steve's approach. I think it would require fairly extensive configuration addition to metadata to support all possible types of restrictions, as they can reference hard coded values, as well as references to child and/or parent fields (with appended hard coded tokens lik

reference-descriptor

2003-02-21 Thread Boulay, Serge
I have a reference-descriptor in one of my mappings . I have set the reference descriptior auto-update = false . When ever I trying inserting an object it crashes cause it is still trying to insert the ref-descriptor . Any ideas why would help . I am using odmg api. Thanks again Serge

Cannot get OJB properties file

2003-02-21 Thread Joerg Lensing
hi all, what am i doing wrong? i did all the things in the tutorials, but i don't get it work. -properties-file is in WEB-INF\classes -classpath in eclipse set to this location thanx joerg equip: JDK 1.4.1 OJB 0.9.9 eclipse 2.0.1 mysql (can access/populate it by build junit)

RE: ClassCastException in OJB 0.9.9 with Oracle 9i

2003-02-21 Thread Andrew Gilbert
Lucy, For us, reverting back Identity from 1.13 rev to 1.12 from CVS helped. But this was only with field conversion issues with a primary key. Not sure this is your case. Plus reverting may reintroduce an issue of double converting More info is in this post: http://archives.apache.org/eye

Re: 1:M querys constraints

2003-02-21 Thread sclark
Here's an idea on the collection restriction discussion. How about something like this: /** * Interface implemented by classes which are used to create a custom * query for the contents of a collection property, when the usual * fk/pk approach is insufficient. */ interface org.apache.ojb.bro

query fails

2003-02-21 Thread Ferran Parra
Hi all, why this query fails with: java.lang.NullPointerException at org.apache.ojb.odmg.oql.OQLQueryImpl.create(Unknown Source) the query is: select object from com.project.user.UserVO where login = admin and password = 21232f297a57a5a743894ae4a801fc3 any idea?? thanks advanced!! Ferran Parra

RE: is this an old .97 bug? (sequencing) - happens in 0.9.9 too

2003-02-21 Thread Ryan Vanderwerf
Luckily the system I'm on doesn't have much concurrent writing of the same objects going on from different app servers/users - it's pretty much a single user logs in and does things to their profile or performs read-operations on other objects. I would like to cover the less than 10% areas where t

Re: 1:M querys constraints

2003-02-21 Thread Jakob Braeuchi
hi bill, what kind of restrictions woukd you need in the collection-descriptor ? do we need the full blown criteria there ? have you already any ideas about the definition of these restrictions ? i'm asking these questions because i do not want to parse restrictions in the collection-descriptor.

Re: Report queries on extents

2003-02-21 Thread Jakob Braeuchi
hi mark, yes, please send me the testcase. if it's based on our testclasses it would be perfect. jakob Mark Rowell wrote: Hi Jakob Some news on this problem -- it turns out it is a case sensitivity issue. E.g. If I query on the column name in the report query (e.g. upper case 'ID') it does no

RE: ClassCastException in OJB 0.9.9 with Oracle 9i

2003-02-21 Thread Lucy Zhao
Armin: SequenceManagerHighLowImpl is generating the primary key which is stored in Oracle 9i as NUMBER. Data conversion is required for two other regular fields. Where exactly is the bug? When will it be fixed? Also is it a common practice to boundle ojb.jar inside myejb.jar file? Thank you very

RE: Oracle sequences/triggers

2003-02-21 Thread Ebersole, Steven
Do either of the following: 1) CREATE OR REPLACE TRIGGER label_id_bri BEFORE INSERT ON labels FOR EACH ROW BEGIN IF :new.label_id IS NULL THEN SELECT label_id_seq.nextval INTO :new.label_id FROM DUAL; END IF; END; -or- 2) CREATE OR REPLACE TRIGGER label_id_b

Re: ClassCastException in OJB 0.9.9 with Oracle 9i

2003-02-21 Thread Armin Waibel
Hi Lucy, there is bug in field conversion when the field is a primay key. Then it seems that the conversion was not done in some cases. regards, Armin - Original Message - From: "Lucy Zhao" <[EMAIL PROTECTED]> To: "'OJB Users List'" <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 4:4

RE: Oracle sequences/triggers

2003-02-21 Thread O'Reilly John
The sequence and trigger are defined as follows: CREATE SEQUENCE label_id_seq INCREMENT BY 1 START WITH 1 MINVALUE 1 MAXVALUE 999 NOCYCLE NOORDER NOCACHE / CREATE OR REPLACE TRIGGER label_id_bri BEFORE INSERT ON labels REFERENCING NEW AS NEW OLD AS OLD FO

RE: How do I see the JUnit failures

2003-02-21 Thread Dwight Jennings
for me (using 0.9.8) they are going into /target/test/test-broker.txt -odmg.txt -soda.txt -Original Message- From: Lance Eason [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:06 AM To: OJB User Mailing

RE: Oracle sequences/triggers

2003-02-21 Thread Ebersole, Steven
If its an actual TRIGGER, then just do a conditional to see if the id is already set before you grab it from the sequence... If its a DEFAULT attribute, then I don't know how you would get around it. |-Original Message- |From: O'Reilly John [mailto:[EMAIL PROTECTED]] |Sent:

How do I see the JUnit failures

2003-02-21 Thread Lance Eason
I just installed 0.9.7. The regression test against hsqldb worked great. I switched over to MSSQL. After changing it to use the JDBC driver we use TdsDriver and fixing the error in objtest-data.dtd so that it actually matches objtest-data.xml the build prepare-testdb worked great against MSSQ

RE: automatic generation of XML mapping files from Java codebase

2003-02-21 Thread Daniel Shriver
-Original Message- >IMO it is important to get a clear picture of your requirements. >1. Do want a transparent persistent store. (and storing data in RDBMS is not >manadtory)or >2. Do want an automated object/relational mapping? (because storing in a >RDBMS is manadatory) > >I've got the

Column 'XXXX' cannot be null

2003-02-21 Thread Ferran Parra
Hi all, i have a write method of bean but... UserVO auxVO = (UserVO) objectVO; // now perform persistence operations Transaction tx = null; // 2. open transaction tx = odmg.newTransaction(); tx.begin(); // 3. acquire write lock on new object tx.lock(auxVO, Transaction.WRITE); /

RE: Oracle sequences/triggers

2003-02-21 Thread O'Reilly John
I could drop the trigger and it would probably work. However, I need the trigger in place as the data can be loaded from other sources. -Original Message- From: Andrew Gilbert [mailto:[EMAIL PROTECTED]] Sent: 21 February 2003 15:51 To: OJB Users List Subject: RE: Oracle sequences/trigger

RE: Oracle sequences/triggers

2003-02-21 Thread Andrew Gilbert
Are you mixing strategies? Drop the trigger in case 2, does it work? -Original Message- From: O'Reilly John [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:23 AM To: '[EMAIL PROTECTED]' Subject: Oracle sequences/triggers Last November a message was posted regarding the us

RE: ClassCastException in OJB 0.9.9 with Oracle 9i

2003-02-21 Thread Lucy Zhao
I have three java data types in the object. The mappings are the following: String - VARCHAR - VARCHAR2 int - INTEGER - NUMBER boolean - BIT - NUMBER(1) The boolean mapping uses "org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldConversion" I think they are all correct mappin

RE: Customizing if a persistente object use the cache or not

2003-02-21 Thread CLARAMONTE Jean-Baptiste
Oh yes also ... We put the cache to on, only for classes that map onto table that don't change to much. -Message d'origine- De : PICARD Jérôme Envoyé : jeudi 6 février 2003 18:15 À : '[EMAIL PROTECTED]' Cc : CLARAMONTE Jean-Baptiste Objet : RE: Customizing if a persistente object use th

Oracle sequences/triggers

2003-02-21 Thread O'Reilly John
Last November a message was posted regarding the use of Oracle Sequences. I was wondering if somone was able to get this working. http://archives.apache.org/eyebrowse/ReadMsg?[EMAIL PROTECTED] e.org&msgId=528894 As posted, I have defined a trigger based oracle sequence such that the DB will gene

RE: ClassCastException in OJB 0.9.9 with Oracle 9i

2003-02-21 Thread Andrew Gilbert
What are some specifics for class and meta data in your scenario? Could it be an issue with the data type your are mapping? http://db.apache.org/ojb/jdbc-types.html -Original Message- From: Lucy Zhao [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:04 AM To: OJB Users List

RE: OJB & JTA Support

2003-02-21 Thread Matthew Baird
I'm waiting till the OTM is done before we rebuilt the JCA connector. One OTM is done, JCA should only take a week to build/test -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED]] Sent: Fri 2/21/2003 3:24 AM To: OJB Users List

RE: Caching of Objects

2003-02-21 Thread Andrew Gilbert
Some confusion in my mind over defining policy at the class/meta level or at the instance/runtime level. Good first step would seem to be ability to define policy at the class/meta data level to start. This need has come up a couple of times on the list. Can also see wanting to override policy

ClassCastException in OJB 0.9.9 with Oracle 9i

2003-02-21 Thread Lucy Zhao
Would some one please throw some light on this? In the design, a stateless session bean passes a persistence broker instance to an OJB component that does the CRUD functions. EJB was deployed to JBoss successfully, but when envoking the OJB component, application throws ClassNotFoundException. So

Re: Caching of Objects

2003-02-21 Thread Armin Waibel
Hi Stefan, I'm thinking to introduce a CacheFilter interface which allows to filter objects before cache, lookup, remove independent from the used cache implementation. Then it would be possible to do public boolean beforeCache(Identity oid, Object obj) { String cacheable = broker.get

Re: Caching of Objects

2003-02-21 Thread Stefan Schlösser
Hi, > Maybe it would be useful to add an attribute 'cacheable' (true|false) to > the > class-descriptor in repository.dtd to flag if an object should be cached > or not. This sounds like a great idea to me, it would solve my problem. In General, I either have just a few objects of the simple typ

Re: Field Conversion not happening - Bug?

2003-02-21 Thread Armin Waibel
Hi Andrew, yes it's a bug. I have made this post on the dev-list a few days ago http://archives.apache.org/eyebrowse/ReadMsg?[EMAIL PROTECTED] ache.org&msgNo=3696 regards, Armin - Original Message - From: "Andrew Gilbert" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, Februar

Re: auto-update, auto-delete set dynamically?

2003-02-21 Thread Robert S. Sfeir
On Friday, Feb 21, 2003, at 04:23 US/Eastern, Armin Waibel wrote: Maybe we should enhance the MM to support different repository profiles, e.g. you could add a 'user' profile and a 'admin' profile. Then it would be possible to use MM.loadProfile(String profileName, boolean global); What do you

Re: auto-update, auto-delete set dynamically?

2003-02-21 Thread Robert S. Sfeir
On Friday, Feb 21, 2003, at 01:18 US/Eastern, Thomas Mahler wrote: The most natural thing would be to encapsulate the different cascade policies in different role classes. Yep I agree. Thanks for filling me in. R -- Robert S. Sfeir Senior Java Engineer National Institutes of Health Center

Field Conversion not happening - Bug?

2003-02-21 Thread Andrew Gilbert
We have a simple class with a primary key that requires custom conversion. The latest build from CVS breaks this. It looks like a change to Identity (rev 1.13). Is this intentional? If so, how is this supposed to work? Assuming a simple class Foo which happens to require a custom conversion for

AW: reverse-db isn't able to change attribute names

2003-02-21 Thread Florian Bruckner
Hi Ricardo, this problem is fixed in CVS. regards, Florian > -Ursprüngliche Nachricht- > Von: Ricardo Tercero Lozano [mailto:[EMAIL PROTECTED]] > Gesendet: Freitag, 14. Februar 2003 13:19 > An: [EMAIL PROTECTED] > Betreff: reverse-db isn't able to change attribute names > > > > I found r

Re: JDO - saving objects duplicity

2003-02-21 Thread Tomas Klubal
Well this is a Debugging message (I=m saving one Person with two addresses): This save wasnt ok, one of the addresses has oidPerson = 0. This address oid is 583. Address with oid 582 has right oidPerson = 562. I also add class definitions of class Person and Address (classes are in package com.

Re: OJB & JTA Support

2003-02-21 Thread Armin Waibel
Hi Nikos, sorry for the late reply. - Original Message - From: "Nikos Vitalis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 19, 2003 5:28 PM Subject: OJB & JTA Support > Hallo, > > i am using ojb (not the odmg or the jdo implementations) and want it to > partcip

Re: Caching of Objects

2003-02-21 Thread Christophe Lombart
I wondering also when the objects in the cache are synchronized with the DB (when a object is refreshed or when a update/insert is made in the DB) ? Are there different strategies to synchronise with the DB ( eg. for read only objects : avoid intensive retrieve from the DB) ? I don't see where al

RE: Report queries on extents

2003-02-21 Thread Mark Rowell
Hi Jakob Some news on this problem -- it turns out it is a case sensitivity issue. E.g. If I query on the column name in the report query (e.g. upper case 'ID') it does not work, if I query on the field name (e.g. lower case 'id') it works. N.B. this therefore is only a problem where we have 2 co

RE: Caching of Objects

2003-02-21 Thread Mahler Thomas
Hi Stefan, > -Original Message- > From: Stefan Schlösser [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 21, 2003 10:51 AM > To: oJB Users List > Subject: Caching of Objects > > > Hi, > > OJB has a build in object cache, > after reading its interface, I got > the impression that I

Re: Caching of Objects

2003-02-21 Thread Armin Waibel
Hi Stefan, - Original Message - From: "Stefan Schlösser" <[EMAIL PROTECTED]> To: "oJB Users List" <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 10:50 AM Subject: Caching of Objects > Hi, > > OJB has a build in object cache, after reading its interface, I got > the impression that I

RE : Prefetch dynamic change

2003-02-21 Thread Jean-Baptiste BRIAUD
Sorry, I should read all new messages before asking questions ! :-) Thanks to all ! __ Jean-Baptiste BRIAUDSysdeo Software engineer www.sysdeo.com www.eclipsetotale.com > -Message d'ori

Re: Prefetch dynamic change

2003-02-21 Thread Armin Waibel
Hi, see more about runtime metadata changes here http://archives.apache.org/eyebrowse/ReadMsg?[EMAIL PROTECTED] pache.org&msgNo=5807 and in javadoc of class MetadataManager (newest version see CVS) regards, Armin - Original Message - From: "Jean-Baptiste BRIAUD" <[EMAIL PROTECTED]> To:

RE: Prefetch dynamic change

2003-02-21 Thread Ricardo Tercero Lozano
see 'auto-update, auto-delete set dynamically?' thread. -Mensaje original- De: Jean-Baptiste BRIAUD [mailto:[EMAIL PROTECTED]] Enviado el: viernes, 21 de febrero de 2003 10:50 Para: 'OJB Users List' Asunto: Prefetch dynamic change Hello, Is it possible to dynamicly change value of au

Caching of Objects

2003-02-21 Thread Stefan Schlösser
Hi, OJB has a build in object cache, after reading its interface, I got the impression that I have to explictly put objects into the cache. This does however not seem to be the case, OJB seems to cache objects on its own accord. Is there some documentation telling me how I can gain control of

Prefetch dynamic change

2003-02-21 Thread Jean-Baptiste BRIAUD
Hello, Is it possible to dynamicly change value of auto-XXX (auto-delete, auto-retrieve, ...) specified in the repository-user.xml ? By "dynamicly" I mean in Java code. Say in the xml file there is the default version, but in Java code I'd like to change value for one shot. Note that I don't wan

Re: is this an old .97 bug? (sequencing) - happens in 0.9.9 too

2003-02-21 Thread Armin Waibel
Hi Ryan, indeed that's a better workaround for the problem. But the same problems (you have with HighLowSequence) could occur with any other persistent capable object. Say server1 and server2 cache object A, now server1 update A-->A'. Then server2 do a select for A and found A not A'. Server2 nev

Re: auto-update, auto-delete set dynamically?

2003-02-21 Thread Armin Waibel
Hi Robert, - Original Message - From: "Robert S. Sfeir" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Thursday, February 20, 2003 11:18 PM Subject: Re: auto-update, auto-delete set dynamically? > Thomas, > > I get this: > > PersistenceBroker broker = null; > broker =

Re: repository questions

2003-02-21 Thread Armin Waibel
Hi David, - Original Message - From: "David Mitchell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 12:23 AM Subject: repository questions > > I have two questions about the repository definitions: > > 1- is it possible to tell OJB not to check for the exi

RE: automatic generation of XML mapping files from Java codebase

2003-02-21 Thread Mahler Thomas
Hi Daniel, some more thoughts: IMO it is important to get a clear picture of your requirements. 1. Do want a transparent persistent store. (and storing data in RDBMS is not manadtory)or 2. Do want an automated object/relational mapping? (because storing in a RDBMS is manadatory) I've got the impr