我有一个名为People
的域名class People
{
Integer id
Person person
static mapping = {
id generator: 'sequence',
params: [table: 'PEOPLE', column: 'ID', max_lo: 100]
person column: "currency", sqlType: "char", length: 3
person column : 'PERSON', sqlType: "PERSONOBJ"
}
}
AND名为person的域
class Person {
String last_Name
String first_Name
}
我想知道如何使用GORM将人们映射到oracle People Table
Person数据类型是PersonObj。这是用户定义类型,如下所示:
create or replace TYPE PersonObj AS OBJECT (
first_name VARCHAR2(50),
last_name VARCHAR2(50)
);
问题是如何将域类人员映射到grails中的people表?
答案 0 :(得分:0)
你可以这样做
class People {
Person person
}
Class Person{
static hasOne = [people:People]
}