Changeset 7643521bc7bcf015411956927dc8fdecebf727ce

Show
Ignore:
Timestamp:
10/21/07 13:38:26 (1 year ago)
Author:
Christopher Jung <bktheg@web.de>
git-committer:
Christopher Jung <bktheg@web.de> 1192966706 +0200
git-parent:

[0c0a0ce562ca418f3a9e9ec26fea21f52d16776c]

git-author:
Christopher Jung <bktheg@web.de> 1192966706 +0200
Message:

Ship: Eigenen ID-Generator fuer DS-Schiffe eingebaut

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/net/driftingsouls/ds2/server/ships/Ship.java

    r8f9e522 r7643521  
    7979import org.apache.commons.lang.StringUtils; 
    8080import org.apache.commons.lang.math.RandomUtils; 
     81import org.hibernate.annotations.GenericGenerator; 
    8182import org.hibernate.annotations.Type; 
    8283 
     
    9495        public static final ContextLocalMessage MESSAGE = new ContextLocalMessage(); 
    9596         
    96         @Id @GeneratedValue 
     97        @Id @GeneratedValue(generator="ds-shipid") 
     98        @GenericGenerator(name="ds-shipid", strategy = "net.driftingsouls.ds2.server.ships.ShipIdGenerator") 
    9799        private int id; 
    98100        @OneToOne(fetch=FetchType.LAZY,mappedBy="ship") 
     
    185187         
    186188        /** 
     189         * Setzt die ID des Schiffes 
     190         * @param id Die ID 
     191         */ 
     192        public void setId(int id) { 
     193                this.id = id; 
     194        } 
     195         
     196        /** 
    187197         * Gibt den Besitzer des Schiffes zurueck 
    188198         * @return Der Besitzer