// Path: app/models/deadbolt/Role.java
// public interface Role
// {
//     /**
//      * The name of the role.
//      *
//      * @return the role name
//      */
//     String getRoleName();
// }
// 
// Path: app/models/deadbolt/RoleHolder.java
// public interface RoleHolder
// {
//     /**
//      * A list of {@link Role}s held by the role holder.
//      *
//      * @return a list of roles
//      */
//     List<? extends Role> getRoles();
// }


import models.deadbolt.Role;
import models.deadbolt.RoleHolder;
import play.data.validation.Required;
import play.db.jpa.Model;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
    @ManyToOne
    public AclApplicationRole role;

    @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE, CascadeType.DETACH})
    public List<AclUser> friends;

    @ManyToMany(cascade = CascadeType.ALL)
    public List<Photo> photos;

    @ManyToMany(cascade = CascadeType.ALL)
    public List<StatusUpdate> statusUpdates;

    @OneToOne(cascade = CascadeType.ALL)
    public AccessControlPreference accessControlPreference;

    public AclUser(String userName,
                   String fullName,
                   AclApplicationRole role)
    {
        this.userName = userName;
        this.fullName = fullName;
        this.role = role;
        this.accessControlPreference = new AccessControlPreference();
    }

    public static AclUser getByUserName(String userName)
    {
        return find("byUserName", userName).first();
    }

// Path: app/models/deadbolt/Role.java
// public interface Role
// {
//     /**
//      * The name of the role.
//      *
//      * @return the role name
//      */
//     String getRoleName();
// }
// 
// Path: app/models/deadbolt/RoleHolder.java
// public interface RoleHolder
// {
//     /**
//      * A list of {@link Role}s held by the role holder.
//      *
//      * @return a list of roles
//      */
//     List<? extends Role> getRoles();
// }


// Path: samples-and-tests/acl/app/model/AclUser.java
import models.deadbolt.Role;
import models.deadbolt.RoleHolder;
import play.data.validation.Required;
import play.db.jpa.Model;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

    @ManyToOne
    public AclApplicationRole role;

    @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE, CascadeType.DETACH})
    public List<AclUser> friends;

    @ManyToMany(cascade = CascadeType.ALL)
    public List<Photo> photos;

    @ManyToMany(cascade = CascadeType.ALL)
    public List<StatusUpdate> statusUpdates;

    @OneToOne(cascade = CascadeType.ALL)
    public AccessControlPreference accessControlPreference;

    public AclUser(String userName,
                   String fullName,
                   AclApplicationRole role)
    {
        this.userName = userName;
        this.fullName = fullName;
        this.role = role;
        this.accessControlPreference = new AccessControlPreference();
    }

    public static AclUser getByUserName(String userName)
    {
        return find("byUserName", userName).first();
    }

    public List<? extends Role> getRoles()