These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Persistent class from one DB but one Long-Value from 2. DB?
PostPosted: Wed Mar 01, 2006 8:18 am 
Newbie

Joined: Wed Mar 01, 2006 7:17 am
Posts: 1
Location: Hamburg, Germany
Hi all!

I'm new to hibernate and got managed to rewrite an existing app to use Hibernate now. But one (maybe small) problem remains.

Some words to explain it:
The app is used to manage orders from an onlineshop. The communication with the customers is done with the OTRS "Trouble Ticket System". Each order has a ticket inside OTRS.

So far I've created the POJOs and mappings for the orders successfully. All the necessary tables are in one DB (shopDB). Now I want to add a field to the Order-Class (private Long otrsTicketId) that holds the ticketId of the OTRS-ticket. I need this to create a link to the corresponding ticket inside the app. The OTRS system has its own DB (otrsDB).

As the FAQ states, I need a second config and SessionFactory for the otrsDB. But how do I map the ticketId to my order? There are no FKs I can use, but the Order.id is mentioned in the subject of the Ticket: "Your order XXXX".

In the old version of my app I got the ticketId with this statement:

Code:
"SELECT ticket_id FROM article WHERE a_subject LIKE '%" + order.getId() + "';"


Can someone give me a hint how to solve this? If possible, I don't want to create extra POJOs for the OTRS-ticket and get only the id as a Long.

Thanks in advance,
Jens


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.