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;
|