選手情報カラムを追加
@@ -1,5 +1,6 @@ | ||
1 | 1 | package cx.myhome.ckoshien.form; |
2 | 2 | |
3 | +import org.seasar.struts.annotation.Maxlength; | |
3 | 4 | import org.seasar.struts.annotation.Required; |
4 | 5 | |
5 | 6 | public class PlayerForm { |
@@ -16,4 +17,7 @@ | ||
16 | 17 | public String password; |
17 | 18 | |
18 | 19 | public String id; |
20 | + | |
21 | + @Maxlength(maxlength=1000) | |
22 | + public String comment; | |
19 | 23 | } |
@@ -10,7 +10,7 @@ | ||
10 | 10 | * {@link Pitching}のプロパティ名の集合です。 |
11 | 11 | * |
12 | 12 | */ |
13 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
13 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
14 | 14 | public class PitchingNames { |
15 | 15 | |
16 | 16 | /** |
@@ -17,7 +17,7 @@ | ||
17 | 17 | * |
18 | 18 | */ |
19 | 19 | @Entity |
20 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
20 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
21 | 21 | public class Player implements Serializable { |
22 | 22 | |
23 | 23 | private static final long serialVersionUID = 1L; |
@@ -48,6 +48,10 @@ | ||
48 | 48 | @Column(precision = 10, nullable = true, unique = false) |
49 | 49 | public Integer authority; |
50 | 50 | |
51 | + /** commentプロパティ */ | |
52 | + @Column(length = 1000, nullable = true, unique = false) | |
53 | + public String comment; | |
54 | + | |
51 | 55 | /** battingDetailList関連プロパティ */ |
52 | 56 | @OneToMany(mappedBy = "player") |
53 | 57 | public List<BattingDetail> battingDetailList; |
@@ -14,7 +14,7 @@ | ||
14 | 14 | * {@link Game}のプロパティ名の集合です。 |
15 | 15 | * |
16 | 16 | */ |
17 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
17 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
18 | 18 | public class GameNames { |
19 | 19 | |
20 | 20 | /** |
@@ -10,7 +10,7 @@ | ||
10 | 10 | * {@link BattingDetail}のプロパティ名の集合です。 |
11 | 11 | * |
12 | 12 | */ |
13 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
13 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
14 | 14 | public class BattingDetailNames { |
15 | 15 | |
16 | 16 | /** |
@@ -10,7 +10,7 @@ | ||
10 | 10 | * {@link BattingSum}のプロパティ名の集合です。 |
11 | 11 | * |
12 | 12 | */ |
13 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
13 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
14 | 14 | public class BattingSumNames { |
15 | 15 | |
16 | 16 | /** |
@@ -10,7 +10,7 @@ | ||
10 | 10 | * {@link Result}のプロパティ名の集合です。 |
11 | 11 | * |
12 | 12 | */ |
13 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
13 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
14 | 14 | public class ResultNames { |
15 | 15 | |
16 | 16 | /** |
@@ -16,7 +16,7 @@ | ||
16 | 16 | * |
17 | 17 | */ |
18 | 18 | @Entity |
19 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
19 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
20 | 20 | public class League implements Serializable { |
21 | 21 | |
22 | 22 | private static final long serialVersionUID = 1L; |
@@ -14,7 +14,7 @@ | ||
14 | 14 | * 名前クラスの集約です。 |
15 | 15 | * |
16 | 16 | */ |
17 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesAggregateModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
17 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesAggregateModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
18 | 18 | public class Names { |
19 | 19 | |
20 | 20 | /** |
@@ -15,7 +15,7 @@ | ||
15 | 15 | * |
16 | 16 | */ |
17 | 17 | @Entity |
18 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
18 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
19 | 19 | public class Pitching implements Serializable { |
20 | 20 | |
21 | 21 | private static final long serialVersionUID = 1L; |
@@ -18,7 +18,7 @@ | ||
18 | 18 | * |
19 | 19 | */ |
20 | 20 | @Entity |
21 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
21 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
22 | 22 | public class Game implements Serializable { |
23 | 23 | |
24 | 24 | private static final long serialVersionUID = 1L; |
@@ -13,7 +13,7 @@ | ||
13 | 13 | * {@link Team}のプロパティ名の集合です。 |
14 | 14 | * |
15 | 15 | */ |
16 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
16 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
17 | 17 | public class TeamNames { |
18 | 18 | |
19 | 19 | /** |
@@ -15,7 +15,7 @@ | ||
15 | 15 | * |
16 | 16 | */ |
17 | 17 | @Entity |
18 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
18 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
19 | 19 | public class BattingDetail implements Serializable { |
20 | 20 | |
21 | 21 | private static final long serialVersionUID = 1L; |
@@ -15,7 +15,7 @@ | ||
15 | 15 | * |
16 | 16 | */ |
17 | 17 | @Entity |
18 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
18 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
19 | 19 | public class BattingSum implements Serializable { |
20 | 20 | |
21 | 21 | private static final long serialVersionUID = 1L; |
@@ -15,7 +15,7 @@ | ||
15 | 15 | * |
16 | 16 | */ |
17 | 17 | @Entity |
18 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
18 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
19 | 19 | public class Result implements Serializable { |
20 | 20 | |
21 | 21 | private static final long serialVersionUID = 1L; |
@@ -11,7 +11,7 @@ | ||
11 | 11 | * {@link Player}のプロパティ名の集合です。 |
12 | 12 | * |
13 | 13 | */ |
14 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
14 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
15 | 15 | public class PlayerNames { |
16 | 16 | |
17 | 17 | /** |
@@ -69,6 +69,15 @@ | ||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | + * commentのプロパティ名を返します。 | |
73 | + * | |
74 | + * @return commentのプロパティ名 | |
75 | + */ | |
76 | + public static PropertyName<String> comment() { | |
77 | + return new PropertyName<String>("comment"); | |
78 | + } | |
79 | + | |
80 | + /** | |
72 | 81 | * battingDetailListのプロパティ名を返します。 |
73 | 82 | * |
74 | 83 | * @return battingDetailListのプロパティ名 |
@@ -201,6 +210,15 @@ | ||
201 | 210 | } |
202 | 211 | |
203 | 212 | /** |
213 | + * commentのプロパティ名を返します。 | |
214 | + * | |
215 | + * @return commentのプロパティ名 | |
216 | + */ | |
217 | + public PropertyName<String> comment() { | |
218 | + return new PropertyName<String>(this, "comment"); | |
219 | + } | |
220 | + | |
221 | + /** | |
204 | 222 | * battingDetailListのプロパティ名を返します。 |
205 | 223 | * |
206 | 224 | * @return battingDetailListのプロパティ名 |
@@ -15,7 +15,7 @@ | ||
15 | 15 | * |
16 | 16 | */ |
17 | 17 | @Entity |
18 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2015/07/22 16:23:17") | |
18 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.EntityModelFactoryImpl"}, date = "2016/03/12 22:46:17") | |
19 | 19 | public class Team implements Serializable { |
20 | 20 | |
21 | 21 | private static final long serialVersionUID = 1L; |
@@ -10,7 +10,7 @@ | ||
10 | 10 | * {@link League}のプロパティ名の集合です。 |
11 | 11 | * |
12 | 12 | */ |
13 | -@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2015/07/22 16:23:20") | |
13 | +@Generated(value = {"S2JDBC-Gen 2.4.46", "org.seasar.extension.jdbc.gen.internal.model.NamesModelFactoryImpl"}, date = "2016/03/12 23:42:26") | |
14 | 14 | public class LeagueNames { |
15 | 15 | |
16 | 16 | /** |
@@ -80,12 +80,13 @@ | ||
80 | 80 | } |
81 | 81 | |
82 | 82 | @Aspect(value="loginConfInterceptor") |
83 | - @Execute(validator = true,input="update",stopOnValidationError=false,validate="createValidate") | |
83 | + @Execute(validator = true,input="update/{id}",stopOnValidationError=true,validate="createValidate") | |
84 | 84 | public String updateComplete(){ |
85 | 85 | player=playerService.findById(Integer.parseInt(playerForm.id)); |
86 | 86 | player.id=Integer.parseInt(playerForm.id); |
87 | 87 | player.name=playerForm.name; |
88 | 88 | player.teamId=Integer.parseInt(playerForm.teamId); |
89 | + player.comment=playerForm.comment; | |
89 | 90 | playerService.update(player); |
90 | 91 | return "index&redirect=true"; |
91 | 92 | } |
@@ -92,6 +93,7 @@ | ||
92 | 93 | |
93 | 94 | @Execute(urlPattern="show/{id}",validator = false) |
94 | 95 | public String show(){ |
96 | + player=playerService.findById(Integer.parseInt(playerForm.id)); | |
95 | 97 | pbrList=battingSumService.findPBRById(Integer.parseInt(playerForm.id)); |
96 | 98 | pbrgoList=battingSumService.findPBRGOById(Integer.parseInt(playerForm.id)); |
97 | 99 | pprList=pitchingService.findPPRById(Integer.parseInt(playerForm.id)); |
@@ -103,7 +105,10 @@ | ||
103 | 105 | ActionMessages errors = new ActionMessages(); |
104 | 106 | player=playerService.findByNameAndTeamId(playerForm.name, Integer.parseInt(playerForm.teamId)); |
105 | 107 | if(player!=null){ |
106 | - errors.add("name", new ActionMessage("既に登録されています", false)); | |
108 | + if(player.comment.equals(playerForm.comment)){ | |
109 | + errors.add("name", new ActionMessage("既に登録されています", false)); | |
110 | + } | |
111 | + | |
107 | 112 | } |
108 | 113 | return errors; |
109 | 114 | } |