-->
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.  [ 1 post ] 
Author Message
 Post subject: Trouble with hib map: linkin through n:m table
PostPosted: Fri Sep 22, 2006 5:13 am 
Newbie

Joined: Fri Sep 22, 2006 5:06 am
Posts: 1
Hello, i got next trouble.
Where my MYSQL schema struct was :
---
Maps:
idMap
name

Cells:
idCell
name

Cells_on_Maps:
idMap (foreigen -> maps)
idCell (foreigen -> cells)
Key
---
my mapping docs looks like
---
<class name="ru.mwo.xmlofss.projects.mwo.obj.map.F_MAP" table="maps" >

<id name="id" type="java.lang.Integer" column="idMap" >
<generator class="increment" />
</id>

<property name="filename" type="java.lang.String" column="filename" not-null="true" length="255" />

<property name="sizeX" type="int" column="sizeX" not-null="true" />
<property name="sizeY" type="int" column="sizeY" not-null="true" />

<property name="xCellOffset" type="java.lang.Double" column="xCellOffset" not-null="true" />
<property name="yCellOffset" type="java.lang.Double" column="yCellOffset" not-null="true" />

<property name="xKoef" type="java.lang.Double" column="xKoef" not-null="true" />
<property name="yKoef" type="java.lang.Double" column="yKoef" not-null="true" />

<property name="yCellAdd" type="java.lang.Double" column="yCellAdd" not-null="true" />

<map name="mapArray" table="maps_cells_indexes" cascade="all">

<key column="idMap" not-null="true" on-delete="cascade" />
<map-key column="key" type="java.lang.Integer"/>
<many-to-many class="ru.mwo.xmlofss.projects.mwo.obj.map.F_CELL" column="idCell" />

</map>

</class>

<class name="ru.mwo.xmlofss.projects.mwo.obj.map.F_CELL" table="maps_cells">

<id name="id" type="java.lang.Integer" column="idCell" >
<generator class="increment" />
</id>

<property name="type" type="int" column="type" not-null="true" />
<property name="level" type="int" column="level" not-null="true" />
<property name="addMP" type="int" column="addMP" not-null="true" />
<property name="addHIT" type="int" column="addHIT" not-null="true" />

</class>
---
and its work fine,
but now i got next struc:
---
Maps:
idMap
name

Cells:
idCell (foreigen -> cells_on_maps)
name

Cells_on_Maps:
idMap (foreigen -> maps)
idCell (primary auto++)
Key
---
and i cant understand, how i can configure links

p.s. sorry for bad english
---
class F_CELL:
public int id;
public int level = 0;
public int addMP = 0; // 9999 if blocked
public int type = 0; // surface - forest, water, sand, grass
// var unit; if unit on cell
public Object item; // not used yet
public int addHIT; // 9999 if cant be fired through
class F_MAP
public int id;
public String filename; // relative path to map SWF file
public int sizeX;
public int sizeY;
public double xCellOffset;
public double yCellOffset;
public double xKoef; // 3/4 radius
public double yKoef; // height
public double yCellAdd; // 1/2 yKoef usually

public Map mapArray;


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

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.