squid:S1213 - The members of an interface declaration or class should appear in a pre-defined order

This commit is contained in:
Mohammed Ezzat
2016-02-06 01:10:56 +02:00
parent 33224dd7d7
commit 9c5745763d
11 changed files with 106 additions and 106 deletions

View File

@ -44,18 +44,22 @@ public class Spell extends BaseEntity {
private String name;
@Id
@GeneratedValue
@Column(name = "SPELL_ID")
private Long id;
@ManyToOne
@JoinColumn(name = "SPELLBOOK_ID_FK", referencedColumnName = "SPELLBOOK_ID")
private Spellbook spellbook;
public Spell() {}
public Spell(String name) {
this();
this.name = name;
}
@Id
@GeneratedValue
@Column(name = "SPELL_ID")
private Long id;
public Long getId() {
return id;
}
@ -63,11 +67,7 @@ public class Spell extends BaseEntity {
public void setId(Long id) {
this.id = id;
}
@ManyToOne
@JoinColumn(name = "SPELLBOOK_ID_FK", referencedColumnName = "SPELLBOOK_ID")
private Spellbook spellbook;
public String getName() {
return name;
}

View File

@ -48,29 +48,11 @@ import com.iluwatar.servicelayer.wizard.Wizard;
@Table(name = "SPELLBOOK")
public class Spellbook extends BaseEntity {
public Spellbook() {
spells = new HashSet<>();
wizards = new HashSet<>();
}
public Spellbook(String name) {
this();
this.name = name;
}
@Id
@GeneratedValue
@Column(name = "SPELLBOOK_ID")
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
private String name;
@ManyToMany(mappedBy = "spellbooks", fetch = FetchType.EAGER)
@ -79,6 +61,24 @@ public class Spellbook extends BaseEntity {
@OneToMany(mappedBy = "spellbook", orphanRemoval = true, cascade = CascadeType.ALL)
private Set<Spell> spells;
public Spellbook() {
spells = new HashSet<>();
wizards = new HashSet<>();
}
public Spellbook(String name) {
this();
this.name = name;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}

View File

@ -45,6 +45,16 @@ import com.iluwatar.servicelayer.spellbook.Spellbook;
@Table(name = "WIZARD")
public class Wizard extends BaseEntity {
@Id
@GeneratedValue
@Column(name = "WIZARD_ID")
private Long id;
private String name;
@ManyToMany(cascade = CascadeType.ALL)
private Set<Spellbook> spellbooks;
public Wizard() {
spellbooks = new HashSet<>();
}
@ -53,12 +63,7 @@ public class Wizard extends BaseEntity {
this();
this.name = name;
}
@Id
@GeneratedValue
@Column(name = "WIZARD_ID")
private Long id;
public Long getId() {
return id;
}
@ -66,12 +71,7 @@ public class Wizard extends BaseEntity {
public void setId(Long id) {
this.id = id;
}
private String name;
@ManyToMany(cascade = CascadeType.ALL)
private Set<Spellbook> spellbooks;
public String getName() {
return name;
}