活动子系统model初始构建完全
This commit is contained in:
parent
e34f87b01c
commit
3fa48eab50
@ -0,0 +1,55 @@
|
||||
package com.codesdream.ase.model.activity;
|
||||
|
||||
import com.codesdream.ase.model.permission.User;
|
||||
import javafx.scene.chart.ScatterChart;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
@Table(name = "user_act")
|
||||
public class UserActivity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private int id;
|
||||
|
||||
//关联的用户
|
||||
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "userActivity")
|
||||
@JoinColumn(nullable = false)
|
||||
private User user;
|
||||
|
||||
//主要负责的活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> manageActivities;
|
||||
|
||||
//次要负责的活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> assistActivities;
|
||||
|
||||
//可见的活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> visibleActivities;
|
||||
|
||||
//创建的活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> createdActivities;
|
||||
|
||||
//可报名的活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> signUpActivities;
|
||||
|
||||
//已经参与的活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> participatedActivities;
|
||||
|
||||
//正在(将要)参与的活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> participatingActivities;
|
||||
|
||||
//打卡签到活动
|
||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private List<Activity> clockIn;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.codesdream.ase.model.permission;
|
||||
|
||||
import com.codesdream.ase.component.UserRolesListGenerator;
|
||||
import com.codesdream.ase.model.activity.UserActivity;
|
||||
import lombok.Data;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
@ -48,6 +49,8 @@ public class User implements UserDetails {
|
||||
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private UserDetail userDetail;
|
||||
|
||||
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
private UserActivity userActivity;
|
||||
|
||||
public User(String username, String password) {
|
||||
this.username = username;
|
||||
|
@ -7,7 +7,7 @@ spring.thymeleaf.encoding=UTF-8
|
||||
|
||||
spring.jpa.generate-ddl=false
|
||||
spring.jpa.show-sql=true
|
||||
spring.jpa.hibernate.ddl-auto=create
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
spring.jooq.sql-dialect=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
spring.jpa.open-in-view=true
|
||||
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
|
||||
|
Loading…
Reference in New Issue
Block a user