Procházet zdrojové kódy

Chan public Connector connector = new Connector();
ges

ailton %!s(int64=7) %!d(string=před) roky
rodič
revize
e71a999044

+ 1 - 1
.classpath

@@ -17,7 +17,7 @@
17 17
 			<attribute name="maven.pomderived" value="true"/>
18 18
 		</attributes>
19 19
 	</classpathentry>
20
-	<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-8-oracle">
20
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
21 21
 		<attributes>
22 22
 			<attribute name="maven.pomderived" value="true"/>
23 23
 		</attributes>

+ 5 - 4
src/main/java/org/develop/officialjournal/controllers/JudgeController.java

@@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
6 6
 import org.springframework.web.bind.annotation.RequestParam;
7 7
 import org.springframework.web.bind.annotation.RestController;
8 8
 
9
+import dao.connection.LuceneConnector;
9 10
 import dao.entity.Judge;
10 11
 import dao.lucene.tables.DAOJudge;
11 12
 
@@ -26,15 +27,15 @@ public class JudgeController {
26 27
 	@RequestMapping("/judge/{id}")
27 28
 	public Judge getById(@PathVariable Integer id ) {
28 29
 
29
-		Judge judge = this.daoJudge.get(id);
30
+		Judge judge = this.daoJudge.get(id, LuceneConnector.getSearcherDisk());
30 31
 		return judge;
31 32
 
32 33
 	}
33 34
 	
34 35
 	@RequestMapping("/judge/{id}/info")
35
-	public Judge getInfoById(@PathVariable Integer id ) {
36
+	public Judge getInfoById(@PathVariable Long id ) {
36 37
 
37
-		Judge judge = this.daoJudge.get(id);
38
+		Judge judge = this.daoJudge.get(id, LuceneConnector.getSearcherDisk());
38 39
 		return judge;
39 40
 
40 41
 	}
@@ -44,6 +45,6 @@ public class JudgeController {
44 45
 	public Judge getByName(@RequestParam (required = true) String name ) {
45 46
 
46 47
 		Judge judge = new Judge(name);
47
-		return daoJudge.get(judge);
48
+		return daoJudge.get(judge, LuceneConnector.getSearcherDisk());
48 49
 	}
49 50
 }

+ 3 - 2
src/main/java/org/develop/officialjournal/controllers/LawyerController.java

@@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
6 6
 import org.springframework.web.bind.annotation.RequestParam;
7 7
 import org.springframework.web.bind.annotation.RestController;
8 8
 
9
+import dao.connection.LuceneConnector;
9 10
 import dao.entity.Lawyer;
10 11
 import dao.lucene.tables.DAOLawyer;
11 12
 
@@ -26,7 +27,7 @@ public class LawyerController {
26 27
 	@RequestMapping("/lawyer/{id}")
27 28
 	public Lawyer getById(@PathVariable Integer id ) {
28 29
 
29
-		Lawyer lawyer = this.daoLawyer.get(id);
30
+		Lawyer lawyer = this.daoLawyer.get(id, LuceneConnector.getSearcherDisk());
30 31
 		return lawyer;
31 32
 
32 33
 	}
@@ -35,6 +36,6 @@ public class LawyerController {
35 36
 	public Lawyer getByName(@RequestParam (required = true) String name ) {
36 37
 
37 38
 		Lawyer lawyer = new Lawyer(name);
38
-		return daoLawyer.get(lawyer);
39
+		return daoLawyer.get(lawyer, LuceneConnector.getSearcherDisk());
39 40
 	}
40 41
 }

+ 7 - 6
src/main/java/org/develop/officialjournal/controllers/ProcessController.java

@@ -9,9 +9,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
9 9
 import org.springframework.web.bind.annotation.RequestParam;
10 10
 import org.springframework.web.bind.annotation.RestController;
11 11
 
12
-
12
+import dao.connection.LuceneConnector;
13 13
 import dao.entity.DOProcess;
14 14
 import dao.entity.Entity;
15
+import dao.lucene.search.DAOSearch;
15 16
 import dao.lucene.tables.DAOProcess;
16 17
 
17 18
 @RestController
@@ -32,9 +33,9 @@ public class ProcessController {
32 33
 	/**returns lawyer by id*/
33 34
 
34 35
 	@RequestMapping("/process/{id}")
35
-	public DOProcess getById(@PathVariable Integer id ) {
36
+	public DOProcess getById(@PathVariable Long id ) {
36 37
 
37
-		DOProcess process = this.daoProcess.get(id);
38
+		DOProcess process = this.daoProcess.get(id, LuceneConnector.getSearcherDisk());
38 39
 		return process;
39 40
 
40 41
 	}
@@ -46,7 +47,7 @@ public class ProcessController {
46 47
 			daoProcess = Database.get().getDaoProcess();
47 48
 		
48 49
 		System.out.println("DAOPROCESS " +daoProcess);
49
-		DOProcess process = this.daoProcess.getAllInfo(id);
50
+		DOProcess process = this.daoProcess.getAllInfo(id, LuceneConnector.getSearcherDisk());
50 51
 		
51 52
 		return process;
52 53
 
@@ -60,7 +61,7 @@ public class ProcessController {
60 61
 		Entity entity = new Entity();
61 62
 		entity.setId(entityId);
62 63
 		entity.setType(type);
63
-		return daoSearch.search(entity, false, processId);
64
+		return daoSearch.search(entity);
64 65
 
65 66
 	}
66 67
 
@@ -70,7 +71,7 @@ public class ProcessController {
70 71
 											  	@RequestParam (required = false, defaultValue= "0") Integer processId   ) 
71 72
 	{
72 73
 		
73
-		List<DOProcess> searchResults =  daoSearch.search(processNumber, true, processId);
74
+		List<DOProcess> searchResults =  daoSearch.search(processNumber);
74 75
 
75 76
 		searchResults.sort(new Comparator<DOProcess>() {
76 77
 

+ 8 - 7
src/main/java/org/develop/officialjournal/controllers/SearchController.java

@@ -7,11 +7,12 @@ import org.springframework.web.bind.annotation.RequestMapping;
7 7
 import org.springframework.web.bind.annotation.RequestParam;
8 8
 import org.springframework.web.bind.annotation.RestController;
9 9
 
10
-
10
+import dao.connection.LuceneConnector;
11 11
 import dao.entity.Entity;
12 12
 import dao.entity.Info;
13 13
 import dao.entity.Judge;
14 14
 import dao.entity.Lawyer;
15
+import dao.lucene.search.DAOSearch;
15 16
 import dao.lucene.tables.DAOEntity;
16 17
 import dao.lucene.tables.DAOJudge;
17 18
 import dao.lucene.tables.DAOLawyer;
@@ -54,20 +55,20 @@ public class SearchController {
54 55
 		Entity entity = new Entity();
55 56
 		entity.setName(text);
56 57
 
57
-		if(daoLawyer.contains(lawyer))
58
+		if(daoLawyer.contains(lawyer, LuceneConnector.getSearcherDisk()))
58 59
 		{
59
-			lawyer = daoLawyer.get(lawyer);
60
+			lawyer = daoLawyer.get(lawyer, LuceneConnector.getSearcherDisk());
60 61
 			return lawyer;
61 62
 		}
62 63
 		
63
-		if(daoJudge.contains(judge))
64
+		if(daoJudge.contains(judge, LuceneConnector.getSearcherDisk()))
64 65
 		{
65
-			judge = daoJudge.get(judge);
66
+			judge = daoJudge.get(judge, LuceneConnector.getSearcherDisk());
66 67
 			return judge;
67 68
 		}
68
-		if(daoEntity.contains(entity))
69
+		if(daoEntity.contains(entity, LuceneConnector.getSearcherDisk()))
69 70
 		{
70
-			entity = daoEntity.get(entity);
71
+			entity = daoEntity.get(entity, LuceneConnector.getSearcherDisk());
71 72
 			return entity;
72 73
 		}
73 74
 		return new Entity();

+ 1 - 0
src/main/java/org/develop/officialjournal/services/Database.java

@@ -3,6 +3,7 @@ package org.develop.officialjournal.services;
3 3
 import java.sql.Connection;
4 4
 
5 5
 import dao.connection.Connector;
6
+import dao.lucene.search.DAOSearch;
6 7
 import dao.lucene.tables.DAOEntity;
7 8
 import dao.lucene.tables.DAOJudge;
8 9
 import dao.lucene.tables.DAOLawyer;