My team uses a slightly modified reverseDB to generate our Java objects and
ojb mapping files.
The majority of our projects are to web enable existing applications, so our
tables already exist, and we just need to create the java and mapping files.
Using reverseDB to generate the classes and
try setting autoincrement=true on the ID mapping
-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Sebastian
Sent: Wednesday, May 19, 2004 1:10 PM
To: [EMAIL PROTECTED]
Subject: MySQL + Native Autoincrement
Hi,
I'm trying to create a record on a table where an
.
Any clues?
Sebastian
McCaffrey, John G. wrote:
try setting autoincrement=true on the ID mapping
-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Sebastian
Sent: Wednesday, May 19, 2004 1:10 PM
To: [EMAIL PROTECTED]
Subject: MySQL + Native Autoincrement
Hi
I am no expert, but I will try to help (use my advice at your own risk!)
assumptions:
payment
contains ref to Account
insert
account
insert payment
assumes Account row exists in DB by the time the payment gets inserted.
is that true? (I guess, if you didn't get
documentation.
regards,
Armin
McCaffrey, John G. wrote:
I would like to know how other teams are using OJB, what
their experiences
have been, and some of the architecture decisions you have
built around OJB.
(I know this is not a pure OJB question, but I would like
to help
I would like to know how other teams are using OJB, what their experiences
have been, and some of the architecture decisions you have built around OJB.
(I know this is not a pure OJB question, but I would like to help compile a
list of common architecture approaches to help new people get started)
Search the archives for SequenceManger and Idenity threads.
Here is what I needed to do:
add a sequence manager to my jdbc-connection-descriptor
sequence-manager
className=org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl
/sequence-manager
Make sure these were set on my primary
are you saying that my reference-descriptor in the Parent table needs to
be removed and instead add it to my child table? If not then, what do you
mean. :)
Thanks
Mark
McCaffrey, John G. [EMAIL PROTECTED] wrote:
Search the archives for SequenceManger and Idenity threads.
Here is what I needed
for over two weeks, and this is a simple project I wrote.
Thanks for you help.
Mark
McCaffrey, John G. [EMAIL PROTECTED] wrote:
yes, (my understanding) if you have a 1-1 relationship, but there is a FK
constraint that indicates a parent child relationship, then OJB wants the
Child Mapping
The object should be updated with its PK after the insert. Try the get
method for that value.
if it is a DB Identity column (and the Get isn't working) you may have to
use a sequenceManager. (If so, look at the sequenceManaging threads, or
Identity threads. It has been well discussed)
HTH
I need to do a query and retrive a filtered set of data.
Basically I have a composite primary key
item_code
Price_Area_code
price_bracket_cd
effect_date
an item can be in multiple price_areas , and will have historical entries
over time.
to get the current row, I have to check effect_date
Richter
[mailto:[EMAIL PROTECTED]
Sent: Monday, April 05, 2004 11:49 AM
To: OJB Users List
Subject: Re: Is it possible to do a Distinct on just one Column? (non
PK)
AFAIK, you will need a ReportQuery.
Richter
McCaffrey, John G. wrote:
I need to do a query and retrive a filtered set of data
, will it have a debuggable version? rc5 didn't (at least as far as I
could see)?
McCaffrey, John G. [EMAIL PROTECTED] and I have been working with
OJB to get the primary key from a native sequence manager. John's using DB2
and I'm using MS SQL Server. Seems like John's solution works, but mine
are dependent on this working. No further
responses from the OJB guys leading me to try something else.
From: McCaffrey, John G. [EMAIL PROTECTED]
To: 'Glenn Barnard' [EMAIL PROTECTED]
Subject: RE: Primary Key from Insert
Date: Thu, 25 Mar 2004 17:05:45 -0600
yeah, I upgraded to rc 5 to fix a bug
);
System.out.println(PK= + val); // IS ALWAYS 0. rs.get(1)
is NULL
}
}
From: McCaffrey, John G. [EMAIL PROTECTED]
Reply-To: OJB Users List [EMAIL PROTECTED]
To: 'OJB Users List' [EMAIL PROTECTED]
Subject: RE: Primary Key from Insert
Date: Fri, 26 Mar 2004 10:37:28
of is that the MS JDBC classes don't work
right. I've been using the same ones for a few years now, so this weekend
I'll upgrade. I'm not holding out much hope since these are the same JDBC
files I used for my test code.
Thanks again!
From: McCaffrey, John G. [EMAIL PROTECTED]
Reply-To: OJB Users
I have a DB generated Identity column for Table A and I am able to use OJB
to insert that object A and see what the identity is with a custom
getLastInsertIdentityQuery() method. (Yay!)
I have a table B that is associated to Table A, but its ID is not generated.
When I insert into Table A and get
: Armin Waibel [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 6:02 PM
To: OJB Users List
Subject: Re: sequence manager help (order of inserts to avoid FK
problems)
Hi John,
McCaffrey, John G. wrote:
I have a DB generated Identity column for Table A and I am able to use OJB
to insert
McCaffrey, John G. wrote:
Almost there!
Ok, I just made the changes you suggested, and it is working, kinda.
I insert table A first (because that's where I get my Id from)
I assign the ID from A into B
then I go to insert table B
if I try to tell it that the primarykey=true and autoincrement
help (order of inserts to avoid FK
problems)
McCaffrey, John G. wrote:
I am using rc 4. i can't get to CVS because I am behind a firewall (and my
manager only wants us to use the labled builds)
I tried your suggestion to set the
primarykey=true, autoincrement=false and access=readonly
the way that I
will find my rows.
-Original Message-
From: McCaffrey, John G. [mailto:[EMAIL PROTECTED]
Sent: Friday, March 19, 2004 1:12 PM
To: 'OJB Users List'
Subject: RE: 1 to 1 mapping
Armin,
First, Thanks for responding I appreciate your assitance.
My problem is that the table B can
I am currently using QueryBySQL in a few places where I have multi-table
joins or otherwise complex queries. I am trying to use QueryBySQL less,
because I think it is seen as a crutch, and that you should use the
mappings. One down side to QueryBySQL is that your select statement is in
your java
John,
you have to declare all PK fields in the collection/reference-descriptor
inverse-foreignkey/foreignkey tags.
McCaffrey, John G. wrote:
I am trying to join two tables A and B
table A has three primary keys
Main_ID
Node_ID
Process_Date
table B has two primary keys
Node_ID
Process_Date
I am trying to join two tables A and B
table A has three primary keys
Main_ID
Node_ID
Process_Date
table B has two primary keys
Node_ID
Process_Date
my mapping has the Table A object containing a collection of B obj
I want to join the collection using the Node_ID, because it is the only
thing
I want to insert an object in to the table ans have the table assign the ID.
If a value is present in the object for the ID variable, the table will
allow that value to be inserted.
If no value is present, the table will create an ID.
My problem is how do I tell OJB not to insert the ID value.
I would like to use QueryBySQL in situations where I have complicated,
multi-join SQL.
I have gotten it to work, using a complicated query, but when I call that
same query again, I have a problem. A big problem. (no exception is thrown,
but my entire websphere server shuts down.)
In diagnosing
I have rc4 in websphere, but I cannot attach the source, so that I can
debug. Is anyone else able to attach the source of OJB in websphere? Is
there a trick to it?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
you may want to create a threaded test to demonstrate concurrent usage.
What will happen when you need a transaction to span multiple tables?
Will you get already in a tranaction errors?
You may want to have your getBroker() method return a new instance
-Original Message-
From: Robert S.
Is there a way to enter a hardcoded value into the table on every insert?
I want to set a maintenanceID (equal to MY_APP_NAME) on all of my tables,
but instead of setting it in the object, I was wondering if it was possible
to set a hardcoded value in the descriptor.
Something like:
I also ran into this issue, as well as the need to dynamically change the
schema between environments (development, test, stage, Production - all
point to different databases/schemas)
I solved this using the following
1. each server has a systemProperty env that indicates whether it is dev
or
Rob,
I have had this problem to, and posted all the info that I could to try to
diagnose the issue, to no avail. I ended up just coding a work around to get
what I needed.
I noticed that when I ran a query to get the count of expected objects, the
count I got back was right, but the collection was
to use OJB tx-demarcation, don't
set 'ConnectionFactoryManagedImpl'.
regards,
Armin
- Original Message -
From: McCaffrey, John G. [EMAIL PROTECTED]
To: 'OJB Users List' [EMAIL PROTECTED]
Sent: Wednesday, July 09, 2003 12:12 AM
Subject: Rollback not happening
hmmm. I must be missing
hmmm. I must be missing something, but I thought if I called
persistanceBroker.beginTransaction();
persistanceBroker.store(brokerVO);
and if there was an exception and persistanceBroker.commitTransaction();
never gets called, then the data should not be in the database.
I am storing a BrokerVO
post your repository_user.xml
do you have auto-delete=true and auto-update= true on your
collection-descriptor?
-Original Message-
From: Jack Collins [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 11:29 AM
To: [EMAIL PROTECTED]
Subject: Changing contents of a 1:n Collection
I have been trying to get around an issue (limited Collection returned
thread) , and I have noticed that if I set auto-retrieve=false on my
reference objects, I get the right number of rows returned (minus the
objects of course). So then I wanted to use the pre-fetched relationships to
fill in
too had a problem with prefetched relationships, db2 and the app jdbc
driver. In my case no rows were returned at all when using prefetched
relationships. the net jdbc driver worked fine.
db2 fixpak 8 solved the problem for me.
cheers,
Michael
On Thu, 2003-06-05 at 20:20, McCaffrey, John G
I am having a problem attaching the source to the lib in WSAD. I want to be
able to debug and set break points so that I can figure out my limited
collection returned problem. I know the process for attaching source in
WSAD, and I did it for rt.jar, and struts.jar, but when I tried
it from a Java project instead of a jar.
Using this method I am able to debug.
Mike
McCaffrey, John G. wrote:
I am having a problem attaching the source to the lib in WSAD. I want to
be
able to debug and set break points so that I can figure out my limited
collection returned problem. I know
.)
The best thing is to include OJB in source.
Just rename db-ojb-1.0.rc3-src.tar to db-ojb-1.0.rc3-src.tgz and
everything will be fine. (It's a stupid MIME type problem on Windows ...)
cheers,
Thomas
McCaffrey, John G. wrote:
I am having a problem attaching the source to the lib in WSAD. I want
what call gets made at LogonManagerBD.java:36 ?
-Original Message-
From: Leon [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 3:18 PM
To: OJB Users List
Subject: why does it return null?
Hi,
I saw some post about this question and solutions on the mail list and
follow the
.submission_date,A0.answer,A0.email,A0.birth_day,A0.
last_name,A0.account_id,A0.question,A0.first_name FROM T_ACCOUNT A0 WHERE
A0.email = ?, shows the filed of email does not have value. Could it be the
point of the problem?
Regards
Leon
- Original Message -
From: McCaffrey, John G
: McCaffrey, John G. [EMAIL PROTECTED]
To: 'OJB Users List' [EMAIL PROTECTED]
Sent: Friday, May 30, 2003 5:52 PM
Subject: RE: Limited collection returned
yes, I also noticed that, and I tried pre-fetching
I take that back, setting eager-release=true had no impact on my results (I
had changed something else, Foolish me)
-John
-Original Message-
From: McCaffrey, John G.
Sent: Monday, June 02, 2003 11:57 AM
To: 'OJB Users List'
Subject: RE: Limited collection returned
Gary,
I tried eager
I have been having the same problem. It seems like the initial query
actually gets all the rows, but the RSIterator only gives you one at a time.
In my situation if I have 4 rows that match the query, and I execute the
query once, I only get one row, each additional time I execute the query I
get
]
Sent: Friday, May 30, 2003 11:47 AM
To: OJB Users List
Subject: RE: Limited collection returned
John
Setting auto-retrieve = false works for me using JBoss mySQL *except*
that then I don't get any dependant ojbects loaded :-(
-Original Message-
From: McCaffrey, John G. [mailto:[EMAIL
works for me using JBoss mySQL *except*
that then I don't get any dependant ojbects loaded :-(
-Original Message-
From: McCaffrey, John G. [mailto:[EMAIL PROTECTED]
Sent: 30 May 2003 17:45
To: 'OJB Users List'
Subject: RE: Limited collection returned
I have been having the same problem
46 matches
Mail list logo