Hibernate: storing a java.util.Map with some extra information
From: Peter Griffin (newsgroups_at_petoria.de)
Date: 12/22/04
- Previous message: _Mario_: "Re: TOMCAT/MYSQL/JSP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 22 Dec 2004 06:04:18 -0800
Hi,
I have a table used by a legacy application:
CREATE TABLE GATHERED_VALUES (
CUSTOMERID VARCHAR(20) NOT NULL,
GROUP VARCHAR(40) NOT NULL,
KEY VARCHAR(40) NOT NULL,
VALUE VARCHAR(40),
PRIMARY KEY (CUSTOMERID, GROUP, KEY)
);
I need to access it from a Java app, if possible via hibernate.
The corresponding hibernate class should be looking something like
this:
public class GatheredValues {
private String customerId;
private String group;
private Map values; // GATHERED_VALUES.KEY, GATHERED_VALUES.VALUE
:
:
}
For creating an instance of GatheredValues I'd like to just hand over
the customer id and the group.
All documentation I read mentioned:
- an ID-column is needed for a Map
- the Map must be stored in a seperate table
Is this true? Does anyone know if my problem can be solved via
hibernate?
Peter
- Previous message: _Mario_: "Re: TOMCAT/MYSQL/JSP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|