Changeset e35d2b99e56605777c70a121f90e24ed626abed4
- Timestamp:
- 08/04/07 23:57:10 (1 year ago)
- git-parent:
- Files:
-
- db/tables/academy.sql (modified) (1 diff)
- db/tables/buildings.sql (modified) (1 diff)
- db/updates.xml (modified) (1 diff)
- src/net/driftingsouls/ds2/server/bases/Academy.java (deleted)
- src/net/driftingsouls/ds2/server/bases/AcademyBuilding.java (added)
- src/net/driftingsouls/ds2/server/entities/Academy.java (modified) (4 diffs)
- web/WEB-INF/cfg/hibernatemappings.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
db/tables/academy.sql
rb195b35 re35d2b9 1 1 CREATE TABLE `academy` ( 2 `id` int(11) NOT NULL auto_increment,3 2 `col` int(11) NOT NULL default '0', 4 3 `train` tinyint(4) NOT NULL default '0', 5 4 `remain` tinyint(4) NOT NULL default '0', 6 5 `upgrade` varchar(10) NOT NULL default '', 7 PRIMARY KEY (`id`), 8 KEY `col` (`col`) 6 PRIMARY KEY (`col`) 9 7 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 10 8 db/tables/buildings.sql
ra6ba521 re35d2b9 39 39 INSERT INTO `buildings` (`id`, `name`, `picture`, `buildcosts`, `consumes`, `produces`, `arbeiter`, `ever`, `eprodu`, `bewohner`, `techreq`, `eps`, `perplanet`, `perowner`, `category`, `ucomplex`, `deakable`, `module`) VALUES (16, 'Titanveredler', 'data/buildings/titanv.png', '0,0,50,70,0,0,0,20,20,0,0,0,0,0,0,0,0,0,', '0,0,0,8,0,0,0,6,0,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,', 30, 8, 0, 0, 3, 0, 0, 0, 2, 0, 1, 'net.driftingsouls.ds2.server.bases.DefaultBuilding'); 40 40 INSERT INTO `buildings` (`id`, `name`, `picture`, `buildcosts`, `consumes`, `produces`, `arbeiter`, `ever`, `eprodu`, `bewohner`, `techreq`, `eps`, `perplanet`, `perowner`, `category`, `ucomplex`, `deakable`, `module`) VALUES (17, 'Forschungszentrum', 'data/buildings/fz.png', '0,0,300,200,0,0,0,150,150,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 0, 0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 'net.driftingsouls.ds2.server.bases.Forschungszentrum'); 41 INSERT INTO `buildings` (`id`, `name`, `picture`, `buildcosts`, `consumes`, `produces`, `arbeiter`, `ever`, `eprodu`, `bewohner`, `techreq`, `eps`, `perplanet`, `perowner`, `category`, `ucomplex`, `deakable`, `module`) VALUES (18, 'Flottenakademie', 'data/buildings/akademie.png', '0,0,200,100,0,0,50,50,50,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 0, 0, 0, 0, 21, 0, 1, 0, 4, 0, 0, 'net.driftingsouls.ds2.server.bases.Academy ');41 INSERT INTO `buildings` (`id`, `name`, `picture`, `buildcosts`, `consumes`, `produces`, `arbeiter`, `ever`, `eprodu`, `bewohner`, `techreq`, `eps`, `perplanet`, `perowner`, `category`, `ucomplex`, `deakable`, `module`) VALUES (18, 'Flottenakademie', 'data/buildings/akademie.png', '0,0,200,100,0,0,50,50,50,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 0, 0, 0, 0, 21, 0, 1, 0, 4, 0, 0, 'net.driftingsouls.ds2.server.bases.AcademyBuilding'); 42 42 INSERT INTO `buildings` (`id`, `name`, `picture`, `buildcosts`, `consumes`, `produces`, `arbeiter`, `ever`, `eprodu`, `bewohner`, `techreq`, `eps`, `perplanet`, `perowner`, `category`, `ucomplex`, `deakable`, `module`) VALUES (19, 'Adamatiumveredler', 'data/buildings/xentv.png', '0,0,80,60,0,0,30,30,40,0,0,0,0,0,0,0,0,0,', '0,0,0,4,0,0,3,2,1,0,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,', 60, 14, 0, 0, 9, 0, 0, 0, 2, 0, 1, 'net.driftingsouls.ds2.server.bases.DefaultBuilding'); 43 43 INSERT INTO `buildings` (`id`, `name`, `picture`, `buildcosts`, `consumes`, `produces`, `arbeiter`, `ever`, `eprodu`, `bewohner`, `techreq`, `eps`, `perplanet`, `perowner`, `category`, `ucomplex`, `deakable`, `module`) VALUES (20, 'Unterirdische Farm', 'data/buildings/farm.png', '0,0,120,150,0,0,60,40,30,5,0,0,0,0,0,0,0,0,', '0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', '1400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,', 80, 18, 0, 0, 25, 0, 0, 0, 1, 1, 1, 'net.driftingsouls.ds2.server.bases.DefaultBuilding'); db/updates.xml
r89d279c re35d2b9 346 346 ADD `scheduled` TINYINT( 1 ) NOT NULL DEFAULT '0'; 347 347 ]]></update> 348 <update type="data" datum="2007-08-04"><![CDATA[ 349 UPDATE buildings SET module='net.driftingsouls.ds2.server.bases.AcademyBuilding' WHERE module='net.driftingsouls.ds2.server.bases.Academy'; 350 ]]></update> 351 <update type="structure" datum="2007-08-04"><![CDATA[ 352 ALTER TABLE `academy` DROP `id`; 353 ALTER TABLE `academy` ADD PRIMARY KEY ( `col` ); 354 ALTER TABLE `academy` DROP INDEX `col`; 355 ]]></update> 348 356 </updates> src/net/driftingsouls/ds2/server/entities/Academy.java
re3938f6 re35d2b9 21 21 import javax.persistence.Entity; 22 22 import javax.persistence.FetchType; 23 import javax.persistence.GeneratedValue;24 23 import javax.persistence.Id; 25 import javax.persistence. JoinColumn;26 import javax.persistence. ManyToOne;24 import javax.persistence.OneToOne; 25 import javax.persistence.PrimaryKeyJoinColumn; 27 26 import javax.persistence.Table; 28 27 … … 37 36 @Table(name="academy") 38 37 public class Academy { 39 @Id @GeneratedValue40 private int id;41 @ ManyToOne(fetch=FetchType.LAZY)42 @ JoinColumn(name="col")38 @Id 39 private int col; 40 @OneToOne(fetch=FetchType.LAZY) 41 @PrimaryKeyJoinColumn 43 42 private Base base; 44 43 private int train; … … 52 51 public Academy() { 53 52 // EMPTY 53 } 54 55 /** 56 * Erstellt eine neue Akademie 57 * @param base Die Basis auf der die Akademie steht 58 */ 59 public Academy(Base base) { 60 this.col = base.getID(); 61 this.base = base; 62 this.upgrade = ""; 54 63 } 55 64 … … 119 128 120 129 /** 121 * Gibt die ID der Akademie zurueck122 * @return Die ID 130 * Gibt die ID der Basis zurueck, auf der sich die Akademie befindet 131 * @return Die ID der Basis 123 132 */ 124 public int get Id() {125 return id;133 public int getBaseId() { 134 return col; 126 135 } 127 136 } web/WEB-INF/cfg/hibernatemappings.xml
rd230b2f re35d2b9 17 17 <mapping class="net.driftingsouls.ds2.server.bases.Building" /> 18 18 <mapping class="net.driftingsouls.ds2.server.bases.DefaultBuilding" /> 19 <mapping class="net.driftingsouls.ds2.server.bases.Academy " />19 <mapping class="net.driftingsouls.ds2.server.bases.AcademyBuilding" /> 20 20 <mapping class="net.driftingsouls.ds2.server.bases.Forschungszentrum" /> 21 21 <mapping class="net.driftingsouls.ds2.server.bases.Kommandozentrale" />
