soft-deleting objects

2004-03-23 Thread Tino Schöllhorn
Hi, I want to implement something like a soft-delete: Objects should be marked as deleted in its corresponing table and OJB should just ignore them when it is materializing or querying them. Where would be the best point to start when I want to implement this feature? I just played around

Strange behaviour: Oracle sequence.nextval

2004-03-23 Thread Richarz, Klaus (Computer Service)
Hi, I am using OJB 1.0rc5 with Oracle8. When I try to store a simple object, the following SQL queries are executed (p6spy.log): 1080045456718|15|0|statement||select TURBINE_USER_SEQ.nextval from dual 1080045456843|0|0|statement|SELECT

Re: soft-deleting objects

2004-03-23 Thread Brian McCallister
If you have a deleted style flag in the database for the soft delete you can probably accomplish this via a query customizer. If you mean to not flag the delete in the database at all, but only treat it as such in the application -- that is a bit trickier, but can probably be done via pb

RE: soft-deleting objects

2004-03-23 Thread Clute, Andrew
I have implemented the very same thing via a custom RowReader. I just extended the default RowReader, and read in the value from that super. After that, I just my criteria to see if I should avoid it, and return based on that. Here is my method that I implemnted that extended

RE: soft-deleting objects

2004-03-23 Thread Daniel Perry
I am using this in a complex app (due to idiot admin users deleting stuff they shouldnt!). All objects have a boolean (mapped to int) deleted. For all queries i look for objects with deleted=false. For relationships, i wrote a querycustomizer which adds deleted=false to collections. (see below

Packed Field (DB2/400) Mapping

2004-03-23 Thread Jay Xu
Hello, I am having a problem with OJB mapping of DB2/400 Packed Field. I mapped Packed Field in DB2/400 to DECIMAL with Java type BigDecimal. When I read records from database, it is fine. But when I try to update the record using OJB, it generates a SQL with that Packed Filed as null value.

Object not PersistenceCapable error

2004-03-23 Thread Philippe Guillard
I've got a JDOUserException/Object not PersistenceCapable error, Can somebody tell me in which direction i should look for my error? I only copied and adapt a working class to another one for another DB table. So the repository.xml is there, don't have enhanced class problems since i use JDO

Re: Object not PersistenceCapable error

2004-03-23 Thread Philippe Guillard
Thanks, i'll check! On Tue, 2004-03-23 at 23:15, Brian McCallister wrote: This usually happens if you are running against a class file (bytecode) that was not enhanced via the JDO bytecode enhancer. I suspect that the enhancer wasn't run, or there is a problem in the .jdo files for that

Primary Key from Insert-Round 2

2004-03-23 Thread Glenn Barnard
Armin, you are correct. The same connection object is being used by the insert and the PK query. I went back to my test app, closing the statement for the insert before creating a new statement for the PK query, and it worked there. However, the problem remains in OJB: the PK query returns

Re: Strange behaviour: Oracle sequence.nextval

2004-03-23 Thread Armin Waibel
Hi Klaus, this could happen the first time a sequence was used, e.g. SequenceManager doesn't accept 0 as PK value and obtain a new PK value from the DB. Here is an example: First time call (DB sequence does not exist, OJB create it on the fly) 1080055631853|150|0|statement||select

access documentation in metadata

2004-03-23 Thread Stefan Sayk
Hello, who can help me? How is it possible to access the documentation in metadata. MetadataManger, ClassDescriptor and FieldDescriptor no problem! But where are the documentation infos? field-descriptor ... documentationFieldDescription/documentation /field-descriptor Stefan Sayk

Re: Newbie Proxy problem

2004-03-23 Thread Mauricio Montblanch
Nop, it did not work, have you any example Edson Carlos Ericksson Richter wrote: As far as you have explained, you should not get ClassCastException. First let's go analize your code: 1) Product implements InterfaceProduct. 2) ProductGroup have a products list. Ok, have you set the

Problem in PersistenceBrokerImpl

2004-03-23 Thread Edson Carlos Ericksson Richter
Hi! I've found a little bug in PersistenceBrokerImpl (latest CVS - downloaded 10 min ago), that can cause a NPE when storing: private Iterator getCollectionIterator(CollectionDescriptor cds, Object collectionOrArray) { Iterator colIterator; if (collectionOrArray instanceof

Re: Newbie Proxy problem

2004-03-23 Thread Edson Carlos Ericksson Richter
I'll try to do show in a sample: public class TestA { public int idA; public java.util.List allB; } public class TestB { public int idB; public int idReferenceToA; public TestA referenceToA; } in XML: class-descriptor class=TestA proxy=dynamic table=TB_A field-descriptor

Re: Problem in PersistenceBrokerImpl

2004-03-23 Thread Edson Carlos Ericksson Richter
Yes, works fine if modifying the method to: private Iterator getCollectionIterator(CollectionDescriptor cds, Object collectionOrArray) { Iterator colIterator; if(collectionOrArray == null) { return null; } if (collectionOrArray instanceof

Re: Newbie Proxy problem

2004-03-23 Thread Edson Carlos Ericksson Richter
Of course, I forget to metion the mandatory interfaces: public interface TestAIF { } public interface TestBIF { } then public class TestA implements TestAIF { } public class TestB implements TestBIF { } Best regards, Edson Richter - Original Message - From: Edson Carlos Ericksson

Re: Problem in PersistenceBrokerImpl

2004-03-23 Thread Armin Waibel
Hi Edson, it's strange. I can find two places in code using getCollectionIterator(...), but can't figure out where the NPE was could be thrown. In PB.deleteCollections(...) a 'null' check is done (line 623). In PB.storeCollections(...) it is possible that null could be passed (line 862), but