Skip to content

Commit 7ac6d1c

Browse files
committed
fix all starting error
1 parent d164505 commit 7ac6d1c

34 files changed

+895
-331
lines changed

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/DeliverablePersistence.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package com.topcoder.onlinereview.component.deliverable;
66

77
import org.springframework.beans.factory.annotation.Autowired;
8+
import org.springframework.beans.factory.annotation.Qualifier;
89
import org.springframework.beans.factory.annotation.Value;
910
import org.springframework.stereotype.Component;
1011

@@ -65,10 +66,10 @@ public class DeliverablePersistence {
6566
+ "INNER JOIN submission_status_lu ON submission.submission_status_id = submission_status_lu.submission_status_id "
6667
+ "WHERE deliverable_lu.per_submission = 1 AND submission_status_lu.name = 'Active' AND ";
6768

68-
@Value("{deliverable.persistence.entity-manager-name}")
69+
@Value("${deliverable.persistence.entity-manager-name}")
6970
private String entityManagerName;
7071

71-
@Autowired private Map<String, EntityManager> entityManagerMap;
72+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
7273
private EntityManager entityManager;
7374

7475
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/UploadManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.slf4j.Logger;
1515
import org.slf4j.LoggerFactory;
1616
import org.springframework.beans.factory.annotation.Autowired;
17+
import org.springframework.beans.factory.annotation.Qualifier;
1718
import org.springframework.beans.factory.annotation.Value;
1819
import org.springframework.stereotype.Component;
1920
import org.springframework.util.MimeType;
@@ -357,17 +358,18 @@ public class UploadManager {
357358
*/
358359
private IDGenerator submissionTypeIdGenerator;
359360

360-
@Autowired private Map<String, EntityManager> entityManagerMap;
361+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
361362
@Autowired private DBHelper dbHelper;
362363

363-
@Value("{review.persistence.entity-manager-name}")
364+
@Value("${review.persistence.entity-manager-name}")
364365
private String entityManagerName;
365366

366367
private EntityManager entityManager;
367368

368369
@PostConstruct
369370
public void postRun() throws IDGenerationException {
370371
entityManager = entityManagerMap.get(entityManagerName);
372+
// TODO
371373
// uploadSearchBundle = uploadSearchBundle;
372374
// submissionSearchBundle = submissionSearchBundle;
373375
uploadIdGenerator = new IDGenerator(UPLOAD_ID_GENERATOR_NAME, dbHelper);

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/UploadPersistence.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213
import org.springframework.util.MimeType;
@@ -38,10 +39,10 @@
3839
public class UploadPersistence {
3940
private static final Logger logger = LoggerFactory.getLogger(UploadPersistence.class.getName());
4041

41-
@Value("{upload.persistence.entity-manager-name}")
42+
@Value("${upload.persistence.entity-manager-name}")
4243
private String entityManagerName;
4344

44-
@Autowired private Map<String, EntityManager> entityManagerMap;
45+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
4546
private EntityManager entityManager;
4647

4748
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/AggregationDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -36,10 +37,10 @@
3637
@Component
3738
public class AggregationDeliverableChecker implements DeliverableChecker {
3839

39-
@Value("{deliverable.persistence.entity-manager-name}")
40+
@Value("${deliverable.persistence.entity-manager-name}")
4041
private String entityManagerName;
4142

42-
@Autowired private Map<String, EntityManager> entityManagerMap;
43+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
4344
private EntityManager entityManager;
4445

4546
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/AppealResponsesDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -51,10 +52,10 @@ public class AppealResponsesDeliverableChecker implements DeliverableChecker {
5152
+ "AND appeal_response_comment_type.name = 'Appeal Response') "
5253
+ "ON appeal_response_comment.review_item_id = appeal_comment.review_item_id";
5354

54-
@Value("{deliverable.persistence.entity-manager-name}")
55+
@Value("${deliverable.persistence.entity-manager-name}")
5556
private String entityManagerName;
5657

57-
@Autowired private Map<String, EntityManager> entityManagerMap;
58+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
5859
private EntityManager entityManager;
5960

6061
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/CommittedReviewDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -35,10 +36,10 @@
3536
@Component
3637
public class CommittedReviewDeliverableChecker implements DeliverableChecker {
3738

38-
@Value("{deliverable.persistence.entity-manager-name}")
39+
@Value("${deliverable.persistence.entity-manager-name}")
3940
private String entityManagerName;
4041

41-
@Autowired private Map<String, EntityManager> entityManagerMap;
42+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
4243
private EntityManager entityManager;
4344

4445
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/FinalFixesDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -32,10 +33,10 @@
3233
*/
3334
@Component
3435
public class FinalFixesDeliverableChecker implements DeliverableChecker {
35-
@Value("{deliverable.persistence.entity-manager-name}")
36+
@Value("${deliverable.persistence.entity-manager-name}")
3637
private String entityManagerName;
3738

38-
@Autowired private Map<String, EntityManager> entityManagerMap;
39+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
3940
private EntityManager entityManager;
4041

4142
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/FinalReviewDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -33,10 +34,10 @@
3334
@Component
3435
public class FinalReviewDeliverableChecker implements DeliverableChecker {
3536

36-
@Value("{deliverable.persistence.entity-manager-name}")
37+
@Value("${deliverable.persistence.entity-manager-name}")
3738
private String entityManagerName;
3839

39-
@Autowired private Map<String, EntityManager> entityManagerMap;
40+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
4041
private EntityManager entityManager;
4142

4243
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/IndividualReviewDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -39,11 +40,11 @@
3940
@Component
4041
public class IndividualReviewDeliverableChecker implements DeliverableChecker {
4142

42-
@Value("{deliverable.persistence.entity-manager-name}")
43+
@Value("${deliverable.persistence.entity-manager-name}")
4344
private String entityManagerName;
4445

4546
@Autowired
46-
private Map<String, EntityManager> entityManagerMap;
47+
@Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
4748
private EntityManager entityManager;
4849

4950
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/SpecificationSubmissionDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -32,10 +33,10 @@
3233
*/
3334
@Component
3435
public class SpecificationSubmissionDeliverableChecker implements DeliverableChecker {
35-
@Value("{deliverable.persistence.entity-manager-name}")
36+
@Value("${deliverable.persistence.entity-manager-name}")
3637
private String entityManagerName;
3738

38-
@Autowired private Map<String, EntityManager> entityManagerMap;
39+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
3940
private EntityManager entityManager;
4041

4142
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/SubmissionDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -45,10 +46,10 @@
4546
*/
4647
@Component
4748
public class SubmissionDeliverableChecker implements DeliverableChecker {
48-
@Value("{deliverable.persistence.entity-manager-name}")
49+
@Value("${deliverable.persistence.entity-manager-name}")
4950
private String entityManagerName;
5051

51-
@Autowired private Map<String, EntityManager> entityManagerMap;
52+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
5253
private EntityManager entityManager;
5354

5455
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/SubmitterCommentDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -34,10 +35,10 @@
3435
@Component
3536
public class SubmitterCommentDeliverableChecker implements DeliverableChecker {
3637

37-
@Value("{deliverable.persistence.entity-manager-name}")
38+
@Value("${deliverable.persistence.entity-manager-name}")
3839
private String entityManagerName;
3940

40-
@Autowired private Map<String, EntityManager> entityManagerMap;
41+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
4142
private EntityManager entityManager;
4243

4344
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/deliverable/checker/TestCasesDeliverableChecker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.topcoder.onlinereview.component.deliverable.DeliverableChecker;
88
import com.topcoder.onlinereview.component.deliverable.DeliverableCheckingException;
99
import org.springframework.beans.factory.annotation.Autowired;
10+
import org.springframework.beans.factory.annotation.Qualifier;
1011
import org.springframework.beans.factory.annotation.Value;
1112
import org.springframework.stereotype.Component;
1213

@@ -32,10 +33,10 @@
3233
*/
3334
@Component
3435
public class TestCasesDeliverableChecker implements DeliverableChecker {
35-
@Value("{deliverable.persistence.entity-manager-name}")
36+
@Value("${deliverable.persistence.entity-manager-name}")
3637
private String entityManagerName;
3738

38-
@Autowired private Map<String, EntityManager> entityManagerMap;
39+
@Autowired @Qualifier("entityManagerMap")private Map<String, EntityManager> entityManagerMap;
3940
private EntityManager entityManager;
4041

4142
@PostConstruct

tc-online-review-api/src/main/java/com/topcoder/onlinereview/component/id/DBHelper.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
package com.topcoder.onlinereview.component.id;
33

44
import org.springframework.beans.factory.annotation.Autowired;
5+
import org.springframework.beans.factory.annotation.Qualifier;
56
import org.springframework.beans.factory.annotation.Value;
67
import org.springframework.stereotype.Component;
78

89
import javax.annotation.PostConstruct;
910
import javax.persistence.EntityManager;
1011
import java.sql.SQLException;
1112
import java.util.HashMap;
13+
import java.util.List;
1214
import java.util.Map;
1315

1416
import static com.google.common.collect.Lists.newArrayList;
@@ -20,7 +22,7 @@ public class DBHelper {
2022
/** The default select sql sentence used for retrieving data from table. */
2123
private static final String DEFAULT_SELECT_NEXT_BLOCK =
2224
"SELECT next_block_start, block_size, exhausted FROM "
23-
+ "id_sequences WHERE name = ? FOR UPDATE";
25+
+ "id_sequences WHERE name = ?";
2426

2527
/** The default sql sentence to update the next_block_start of the table. */
2628
private static final String DEFAULT_UPDATE_NEXT_BLOCK_START =
@@ -48,10 +50,13 @@ public class DBHelper {
4850
/** the sql sentences support for generating ids */
4951
private Map<String, String> sqlSentences = new HashMap();
5052

51-
@Value("{id.persistence.entity-manager-name}")
53+
@Value("${id.persistence.entity-manager-name}")
5254
private String entityManagerName;
5355

54-
@Autowired private Map<String, EntityManager> entityManagerMap;
56+
@Autowired
57+
@Qualifier("entityManagerMap")
58+
private Map<String, EntityManager> entityManagerMap;
59+
5560
private EntityManager entityManager;
5661

5762
@PostConstruct
@@ -75,7 +80,7 @@ public void postRun() {
7580
* @throws SQLException if any error occurs while accessing database.
7681
* @throws IDGenerationException if the connection to the database cannot be created.
7782
*/
78-
public Object execute(String key, Object[] parameters)
83+
public List<Map<String, Object>> execute(String key, Object[] parameters)
7984
throws SQLException, IDGenerationException {
8085
return tryExecute(key, parameters);
8186
}
@@ -105,7 +110,7 @@ public void releaseDatabaseResources(boolean force) {}
105110
* @throws IllegalArgumentException if the key is null or empty or not a key to a desired sql
106111
* statement.
107112
*/
108-
private Object tryExecute(String key, Object[] parameters) {
113+
private List<Map<String, Object>> tryExecute(String key, Object[] parameters) {
109114
if ((key == null) || (key.trim().length() == 0)) {
110115
throw new IllegalArgumentException("The key should not be null or empty!");
111116
}

0 commit comments

Comments
 (0)