facebook

hibernate mapping in 3.8 GA

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #212189 Reply

    snpe
    Member

    I 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 etc

    MyEclipse 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

    #212247 Reply

    Riyad Kalla
    Member

    Did 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?

    #212258 Reply

    snpe
    Member

    I 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

    #212271 Reply

    vbfischer
    Member

    Same 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.

    #212273 Reply

    snpe
    Member

    I 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

    #212285 Reply

    snpe
    Member

    Yes, 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

    #212286 Reply

    Riyad Kalla
    Member

    Can you upgrade to MyEclipse 3.8 GA and see if that helps?

    #212299 Reply

    snpe
    Member

    I am on 3.8 GA

    #212302 Reply

    Riyad Kalla
    Member

    I asked the hibernate dev to look at this.

    #212356 Reply

    support-jeff
    Member

    snpe –

    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!

    #212409 Reply

    snpe
    Member

    – 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 mapping

    My tables have such FK keys – it is big real schema

    regards

    #212414 Reply

    snpe
    Member

    My 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

    #212487 Reply

    support-jeff
    Member

    Sorry! That should also include:
    Abstract<TableName>.java

    #212488 Reply

    support-jeff
    Member

    snpe –

    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!

    #212505 Reply

    snpe
    Member

    Jeff,
    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 long

    regards

Viewing 15 posts - 1 through 15 (of 26 total)
Reply To: hibernate mapping in 3.8 GA

You must be logged in to post in the forum log in