-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: middlegen and mapping generate from command line
PostPosted: Tue Jul 20, 2004 5:48 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Hello,
Can I do mapping generate from command line or java application with adding table name (or table names) without swing gui

regards
Haris Peco


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 12:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Yes - make sure the ant script has GUI="false".


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 5:58 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Hello David,
I try and it work, but I have any problems
a) my schema is big (>400 tables, >300 foreign key)
I select 5 tables and two is :
SQL> desc fin_nks
Name Null? Type
------------------------------- -------- ----
NK NOT NULL NUMBER(6)
RED NOT NULL NUMBER(6)
OPN NOT NULL VARCHAR2(4)
KON NOT NULL VARCHAR2(10)
DATD DATE
DATV DATE
DUG NUMBER
POT NUMBER
SIFD VARCHAR2(40)
KIFKUF VARCHAR2(20)
ANAL VARCHAR2(6)
DUGS VARCHAR2(1)
POTS VARCHAR2(1)
VAL VARCHAR2(3)

SQL> desc fin_nk
Name Null? Type
------------------------------- -------- ----
ID NOT NULL NUMBER(6)
RJ NOT NULL VARCHAR2(6)
VN NOT NULL VARCHAR2(4)
ZAP NOT NULL VARCHAR2(6)
DAT DATE
OK VARCHAR2(1)
ZAK VARCHAR2(1)

middlegen don't generate table FIN_NK - it generate only fin_nks with name
FinNk.hbm.xml
column val haven't properties - it is non mandatory foreign key for table FIN_VAL (I don't select FIN_VAL in list and this is reason, maybe)

Question :
1. table FIN_NK isn't generate and table FIN_NKS generate in file
FinNk.hbm.xml - Why ?

2. Init middlegen is > 4 minutes long (pentium III, 512 mb jdk 1.4.2 linux 2.4.23) - Why ?

3. I want add popup menu in eclipse sqlexlporer - when user choose any table and this menu then middlegen generate mapping files - What class do generate ?

4. Is middlegen hibernate plugin 5 in middlgen cvs ?

Thanks

regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 6:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
1) It is a name clash since Middlegen plurises / singularises names.
You can use the <table> tag to get around this.
2) Middlegen has to read all of the tables and all of the meta data for each table thus it takes time (400+ tables is a decent size). Again you can use table tag to reduce the nuymber of tables it will read at a time.
3) Middlegen external interface is setup for Ant usage - it would be an interesting exercise.
4) Yes - R5 is a snapshot of the lasted development source in CVS (HEAD).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 6:59 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
1) I don't understand - I use table tag with only fin_nk and fin_nks
2) same like 1
3) ??
4) fine, I make hibernate plugin for me from CVS - I don't found r5 plugin on sourceforge

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 8:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I released the plugin last night may not have been populated to all the mirrors as yet.

Try http://prdownloads.sourceforge.net/hibernate/?sort_by=date&sort=desc
It was the first entry when I just had a look.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 2:33 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
I find plugin, but ii isn't same like my CVS version
I configure database and build.xml same and Middlegen-Hibernate-r5 return error
middlegen.MiddlegenException: Wow! Synonym APL not found. How can it happen?

This error isn't exists in my cvs version

I have APL synonym and it is correct

regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 7:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I'm not sure whats up for you and I don't currenlty have enough information to say. If the CVS version you have built works for you then thats great - use it and forget about my R5 build.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 7:20 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
don't work for all, but better than r5
I send message for problem with table names fin_nk and fin_nks
(r5 work nothing - don't start becasue error before)

- problem isn't resolved when I set table in <table

I can't rename table - how I can resolve this

and with big schema middlegen init is long time with table tag and only tow tables - init search all schema

regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 7:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Post a SMALL example of the tables involves so I have a test that I can followup on and try and fix the issue. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 7:50 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
You have table description in second message in this thread

this is create script:

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)
)
tablespace "&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)
using index
tablespace "&1"
/

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)
using index
tablespace "&1"
/

alter table fin_nks add
constraint fin_nks_nk
foreign key (nk)
references fin_nk(id)
/

tables have yet foreign keys for any tables in schema, but I send
only for this two tables

regards

p.s
I set class name in preferences file and I get mapping for both tables
init is slow (4-5 minutes)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 21, 2004 7:51 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
add

database is oracle 8.0 on linux (jdbc driver ojdbc14.jar for oracle 9.2)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.