- This topic has 25 replies, 5 voices, and was last updated 20 years, 3 months ago by support-jeff.
-
AuthorPosts
-
snpeMemberI try hibernate mapping (MyEclipse 3.8 GA, eclipse 3.0, linux gtk)
I set driver, choose table and call popup ‘hibernate mapping’ – set package,
base class, Id generator etcMyEclipse don;t return error, but I haven’t mapping file
I try differnt combination for package, base class (and no base class),ID generator without success
What is wrong ?
regards
Riyad KallaMemberDid you check the root of your source tree or root of project to see if it ended up there?
Can you tell us some of the settings you were using so we can try and duplicate it here? What DB? What driver?
snpeMemberI check root project tree, workspace , my root, eclipse home
What is file name – Tablename.hbm/.xml ?
I check all .xml files in my tree – it have nothing
my database is oracle 8.0, driver for oracle 9.2 (ojdbc14.jar) – it work with beta 2 (created mapping is not too good, but it exists)
I use DB explorer – right click and hibernate mapping
regards
vbfischerMemberSame here. It worked when I selected “Update Hibernate Configuration”. It didn’t work when it wasn’t selected (I use Spring, so I don’t have a hibernate configuration.
snpeMemberI try again with empty workspace
create project, add hibernate capabilities – hibernate.cfg.xml is ok
When I try hibernate mapping from Db explorer , MyEclipse do nothing again
regards
snpeMemberYes, it wokr with checked ‘Update configuration’, but don’t work with composite key (error ‘Unable to update Hibernate mapped object classes.
Error updating Hibernate mapped object composite key class: XXKey.java)I don’t understand – what have configuration file for hibernate and reverse mapping ?
Problem 2 : oracle type number is number with arbitrary number of decimal places (38 signed digit), but it mapped like Long – it isn’t long – it is big_decimal
regards
Riyad KallaMemberCan you upgrade to MyEclipse 3.8 GA and see if that helps?
snpeMemberI am on 3.8 GA
Riyad KallaMemberI asked the hibernate dev to look at this.
support-jeffMembersnpe –
So the mapped classes themselves are produced and no mapping file? Or nothing at all? If you select a single table, you should get:
<TableName>.java
<TableName>.hbm.xml
<TableName>Key.java (only if the table has a composite key)None of these show up?
There is a bug with composite keys – if the pk contains a column that is also a fk to another table, there is a problem. I am looking into this now. Is this the case with the table you are trying to map?
Also, do you get any error dialogs or error messages in the Error Log? Please forward what ever you see there.
Thanx for the patience and the feedback!
snpeMember– myeclipse return nothing – no error, no *.hbm.xml, no *.java
– when I check ‘update configuration file’ i get TableName.hbm.xml, but no
TableName.java
If I have composite key I get error dialog that can’t create TableNameKey.java
Base table mapping (hbm.xml) is created, but no *java and composite key mappingMy tables have such FK keys – it is big real schema
regards
snpeMemberMy first problem is hibernate.cfg.xml file – Why You need this file for ddl to xbm mapping ?
If I use old project myeclipse seek cfg in /hibernate.cfg.xml always (i change property in project properties)
regards
support-jeffMemberSorry! That should also include:
Abstract<TableName>.java
support-jeffMembersnpe –
Please send me more info on your environment – what database and driver? Could you send me the DDL for the tables you are trying to map?
Thanx again!
snpeMemberJeff,
I send driver and database : database Oracle 8.0.5 for Linux, driver
ojdbc14.jar (driver from oracle 9.2)My schema is big, but this is relevant part :
create table fin_nk (
id number(6) not null,
rj varchar2(6) not null,
vn varchar2(4) not null,
zap varchar2(6) not null,
dat date,
ok varchar2(1),
zak varchar2(1)
)
/create table fin_nks (
nk number(6) not null,
red number(6) not null,
opn varchar2(4) not null,
kon varchar2(10) not null,
datd date,
datv date,
dug number,
pot number,
sifd varchar2(40),
kifkuf varchar2(20),
anal varchar2(6),
dugs varchar2(1),
pots varchar2(1),
val varchar(3)
)
/alter table fin_nk add
constraint fin_fin_nk_prim
primary key (id)
/alter table fin_nk add
constraint fin_nk_ok
check (ok is null or ok = ‘D’)
/alter table fin_nk add
constraint fin_nk_zak
check (zak is null or zak = ‘D’)
/alter table fin_nks add
constraint fin_fin_nks_prim
primary key (nk,red)
/alter table fin_nks add
constraint fin_nks_nk
foreign key (nk)
references fin_nk(id)
/1) Why reverse engine need hibernate.cfg.xml ?
2) oracle type number isn’t long – this is number with arbitrary decimal places (to 38 signed digit) – it is mapped to longregards
-
AuthorPosts