⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 league.java

📁 JavaeeTutorial5的源代码。
💻 JAVA
字号:
/* * Copyright 2007 Sun Microsystems, Inc. * All rights reserved.  You may not modify, use, * reproduce, or distribute this software except in * compliance with  the terms of the License at: * http://developer.sun.com/berkeley_license.html */package roster.entity;import java.util.Collection;import static javax.persistence.CascadeType.ALL;import javax.persistence.Entity;import javax.persistence.Id;import javax.persistence.OneToMany;import javax.persistence.Table;@Entity@Table(name = "EJB_ROSTER_LEAGUE")public abstract class League implements java.io.Serializable {    protected Collection<Team> teams;    protected String id;    protected String name;    protected String sport;    @Id    public String getId() {        return id;    }    public void setId(String id) {        this.id = id;    }    public String getName() {        return name;    }    public void setName(String name) {        this.name = name;    }    public String getSport() {        return sport;    }    public void setSport(String sport) {        this.sport = sport;    }    @OneToMany(cascade = ALL, mappedBy = "league")    public Collection<Team> getTeams() {        return teams;    }    public void setTeams(Collection<Team> teams) {        this.teams = teams;    }    public void addTeam(Team team) {        this.getTeams()            .add(team);    }    public void dropTeam(Team team) {        this.getTeams()            .remove(team);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -