-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with maping
PostPosted: Wed Jun 14, 2006 11:25 am 
Newbie

Joined: Wed Jun 14, 2006 11:02 am
Posts: 2
CREATE TABLE Indeks (
broj VARCHAR2 ( 10 ) NOT NULL,
JMBG VARCHAR2 ( 13 ) NOT NULL,
ime VARCHAR2 ( 30 ) NOT NULL,
prezime VARCHAR2 ( 30 ) NOT NULL,
imeOca VARCHAR2 ( 30 ) NOT NULL,
datumRodjenja DATE,
datumUpisa DATE NOT NULL,
pol NUMBER ( 5 ),
sfrSedisteFakultetaMesto NUMBER ( 5 ),
sfrOpstinaRodjenja NUMBER ( 5 ),
sfrMestoRodjenja NUMBER ( 5 ),
sfrSprema NUMBER ( 5 ),
sfrFakultet NUMBER ( 5 ) NOT NULL,
email VARCHAR2 ( 80 ),
sfrDrzava NUMBER ( 5 ),
status NUMBER ( 2 ),
sfrRokPrijemni NUMBER ( 5 ),
sfrPr VARCHAR2 ( 20 ),
CONSTRAINT PK_Indeks754 PRIMARY KEY (broj)
)


CREATE TABLE Lozinka (
password VARCHAR2 ( 15 ) NOT NULL,
broj VARCHAR2 ( 10 ) NOT NULL,
CONSTRAINT PK_Lozinka1076 PRIMARY KEY (broj)
)

ALTER TABLE Lozinka ADD ( CONSTRAINT FK_Lozinka1748 FOREIGN KEY (broj) REFERENCES Indeks (broj))



Could somebody write me a mapping file for Lozinka?[/img]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 14, 2006 7:13 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Code:
<class name="Indeks" ...>
  <id name="Broj" column="broj" .../>
  <set name="Lozinka" ...>
    <key column="broj" not-null="true"/>
    <one-to-many class="Lozinka"/>
  </set>
  ...
</class>
<class name="Lozinka" ...>
  <id name="Broj" column="broj" .../>
  <many-to-one name="Indeks" column="broj" insert="false" update="false"/>
  <property name="Password" column="password" type="string" not-null="true"/>
</class>

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.