This content has been marked as final. Show 1 reply
I'm not sure of your background or experience with TopLink, but the old TOPLink config you are using should work and look pretty similar to the Oracle TopLink or native EclipseLink config.
What I'm missing from your description is what you mean when you discuss what you change and works vs the changes you need to perform now. You only show the Trade object and its "tradeCodeId" pk, so I can only guess what you mean when you say you want to update a tradeCodeId for the customer. Do you mean that the Customer table has a tradeCodeId or a reference to a Trade object?
As long as the field is not appart of the primary key, it should be able to be changed. The only problem I forsee you might encounter is with creating a new Trade instance and persisting it in the database - the primary key mapping for tradeCodeId has setIsReadOnly(true) called on it, which might cause problems in trying to set this value.
Other than that, you would just use an expression query in the same way the application might look up a customer now. Something like:
ReadQuery query = new ReadObjectQuery(Trade.class);
Vector arguments = new Vector();
Trade trade = (Trade)session.executeQuery(query, arguments);