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