package models;

import play.data.validation.Constraints;
import play.db.ebean.Model;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@Table(name = "powerup")
public class PowerupModel extends Model {
    public static Model.Finder<Long, PowerupModel> find = new Model.Finder<>(Long.class, PowerupModel.class);

    @Id
    public Long id;

    @Constraints.Required
    public String className;

    @Constraints.Required
    public String friendlyName;

    @Constraints.Required
    public boolean isMandatory;

    @Constraints.Required
    public boolean hasMenuEntry;

    @OneToMany(cascade = CascadeType.PERSIST)
    public List<Activation> activations = new ArrayList<>();

}

@@ -164,396 +164,2333 @@
 t;%0A%0A
-@Entity%0A@Table(name = %22powerup%22)%0Apublic class PowerupModel extends Model %7B%0A    public static Model.Finder%3CLong, PowerupModel%3E find = new Model.Finder%3C%3E(Long.class, PowerupModel.class);%0A%0A    @Id%0A    public Long id;%0A%0A    @Constraints.Required%0A    public String className;%0A%0A    @Constraints.Required%0A    public String friendlyName;%0A%0A    @Constraints.Required%0A    public boolean isMandatory;%0A
+/**%0A * The PowerupModel is an Ebean ORM representation of the class used to instatiate a %7B@link powerups.Powerup%7D%0A * The actual powerup is instantiated by the Powerup class through lazy loading, which is in no way safe unless%0A * care is taken to ensure that the className field is entered as noted below. It is imperative that each field for the%0A * powerup is filled out precisely, or unpredictable behaviour might occur. This is, as above, due to the behaviour of%0A * the class loader.%0A * @see powerups.Powerup%0A * @see com.avaje.ebean.Ebean%0A * @see play.db.ebean.Model%0A */%0A@Entity%0A@Table(name = %22powerup%22)%0Apublic class PowerupModel extends Model %7B%0A    public static Model.Finder%3CLong, PowerupModel%3E find = new Model.Finder%3C%3E(Long.class, PowerupModel.class);%0A%0A    @Id%0A    public Long id;%0A%0A    /**%0A     * This is the qualified name of the class instantiated by the %7B@link powerups.Powerup%7D class within the powerups%0A     * package. As an example, the DescriptionPowerup class resides in the powerups.core.descriptionpowerup package,%0A     * so its className should be %22core.descriptionpowerup.DescriptionPowerup%22. Please do not label a powerup as core%0A     * unless it is intended to be mandatory and used by every club.%0A     * @see powerups.core.descriptionpowerup.DescriptionPowerup%0A     */%0A    @Constraints.Required%0A    public String className;%0A%0A    /**%0A     * This field is used to generate the name of the powerup that appears to the user. It is therefore imperative that%0A     * this name is filled out as you wish it to appear.%0A     */%0A    @Constraints.Required%0A    public String friendlyName;%0A%0A    /**%0A     * This field is used to determine if any new clubs should automatically have this powerup activated for them.%0A     * @see models.Activation%0A     * @see models.Club%0A     */%0A    @Constraints.Required%0A    public boolean isMandatory;%0A%0A    /**%0A     * This field is used to determine whether or not the powerup's view should be linked to at the top of a club's%0A     * associated view. Please keep in mind that not all powerups should have a menu entry. For example, we do not%0A     * require a link that takes us to the club's image. This is also used to determine whether or not this powerup%0A     * should have a headline above it, though this is subject to change in the future.%0A     * @see views.html.club.show%0A     */
 %0A   

Document PowerupModel.