1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.generator.config;
17
18 import static org.mybatis.generator.internal.util.messages.Messages.getString;
19
20 import java.util.List;
21
22 import org.mybatis.generator.internal.util.StringUtility;
23
24 public class ConnectionFactoryConfiguration extends TypedPropertyHolder {
25
26 public ConnectionFactoryConfiguration() {
27 super();
28 }
29
30 public void validate(List<String> errors) {
31 if (getConfigurationType() == null || "DEFAULT".equals(getConfigurationType())) {
32 if (!StringUtility.stringHasValue(getProperty("driverClass"))) {
33 errors.add(getString("ValidationError.18",
34 "connectionFactory",
35 "driverClass"));
36 }
37
38 if (!StringUtility.stringHasValue(getProperty("connectionURL"))) {
39 errors.add(getString("ValidationError.18",
40 "connectionFactory",
41 "connectionURL"));
42 }
43 }
44 }
45 }