Hi STefan, http://jakarta.apache.org/ojb/apidocs/org/apache/ojb/broker/PersistenceBroke r.html#store(java.lang.Object,%20org.apache.ojb.broker.util.ObjectModificati on)
allows to specify wether to use isert or update, by a ObjectModification (http://jakarta.apache.org/ojb/apidocs/org/apache/ojb/broker/util/ObjectModi fication.html) parameter. The class ObjectModificationDefaultImpl has public static ObjectModification constants INSERT and UPDATE. cheers, Thomas > -----Ursprüngliche Nachricht----- > Von: Stefan Schlösser [mailto:[EMAIL PROTECTED]] > Gesendet: Donnerstag, 13. Februar 2003 16:40 > An: oJB Users List > Betreff: broker.store() always no distinction between insert or update > ?? > > > Hi, > > I very much like the interface store of the broker which shields me > from the differences between insert or update. Sometimes however I > would like to prevent an update when an insert is not possible. E.g a > legacy application does not allow some records to be updated but only > to be inserted. > > When programming with the standard jdbc layer I get an exception > telling me insert is not possible e.g. due to primary key conflict. > Ojb when automatically seems to perform an update which under certain > circumstances is not what I need. > > Is there a way to prevent this behavior, or do I need to perform a > lookup before a store to implement this ? > > Thanks for your help, > > Stefan Schlösser > > --------------------------------------------------------------------- > 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]