Changeset 8e901a3089c518329c8efe4e02585e51a6514836
- Timestamp:
- 08/05/07 00:00:42
(1 year ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1186264842 +0200
- git-parent:
[e35d2b99e56605777c70a121f90e24ed626abed4]
- git-author:
- Christopher Jung <bktheg@web.de> 1186264842 +0200
- Message:
AdminCommands?: Weiteren Teil auf Hibernate umgestellt
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rbed664f |
r8e901a3 |
|
| 57 | 57 | import net.driftingsouls.ds2.server.ships.ShipTypeData; |
|---|
| 58 | 58 | import net.driftingsouls.ds2.server.tasks.Taskmanager; |
|---|
| | 59 | import net.driftingsouls.ds2.server.werften.ShipWerft; |
|---|
| 59 | 60 | |
|---|
| 60 | 61 | import org.apache.commons.lang.StringUtils; |
|---|
| … | … | |
| 214 | 215 | } |
|---|
| 215 | 216 | |
|---|
| 216 | | Database database = ContextMap.getContext().getDatabase(); |
|---|
| 217 | 217 | if( shiptype.getWerft() != 0 ) { |
|---|
| 218 | | SQLResultRow wid = database.first("SELECT id FROM werften WHERE shipid="+ship.getId()); |
|---|
| 219 | | if( wid.isEmpty() ) { |
|---|
| 220 | | database.update("INSERT INTO werften (shipid) VALUES ("+ship.getId()+")"); |
|---|
| | 218 | ShipWerft werft = (ShipWerft)db.createQuery("from ShipWerft where shipid=?") |
|---|
| | 219 | .setInteger(0, ship.getId()) |
|---|
| | 220 | .uniqueResult(); |
|---|
| | 221 | |
|---|
| | 222 | if( werft == null ) { |
|---|
| | 223 | werft = new ShipWerft(ship); |
|---|
| | 224 | db.persist(werft); |
|---|
| 221 | 225 | } |
|---|
| 222 | 226 | } |
|---|