Browse Source

Chan public Connector connector = new Connector();
ges

ailton 8 years ago
parent
commit
e71a999044

+ 1 - 1
.classpath

17
 			<attribute name="maven.pomderived" value="true"/>
17
 			<attribute name="maven.pomderived" value="true"/>
18
 		</attributes>
18
 		</attributes>
19
 	</classpathentry>
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
 		<attributes>
21
 		<attributes>
22
 			<attribute name="maven.pomderived" value="true"/>
22
 			<attribute name="maven.pomderived" value="true"/>
23
 		</attributes>
23
 		</attributes>

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

6
 import org.springframework.web.bind.annotation.RequestParam;
6
 import org.springframework.web.bind.annotation.RequestParam;
7
 import org.springframework.web.bind.annotation.RestController;
7
 import org.springframework.web.bind.annotation.RestController;
8
 
8
 
9
+import dao.connection.LuceneConnector;
9
 import dao.entity.Judge;
10
 import dao.entity.Judge;
10
 import dao.lucene.tables.DAOJudge;
11
 import dao.lucene.tables.DAOJudge;
11
 
12
 
26
 	@RequestMapping("/judge/{id}")
27
 	@RequestMapping("/judge/{id}")
27
 	public Judge getById(@PathVariable Integer id ) {
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
 		return judge;
31
 		return judge;
31
 
32
 
32
 	}
33
 	}
33
 	
34
 	
34
 	@RequestMapping("/judge/{id}/info")
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
 		return judge;
39
 		return judge;
39
 
40
 
40
 	}
41
 	}
44
 	public Judge getByName(@RequestParam (required = true) String name ) {
45
 	public Judge getByName(@RequestParam (required = true) String name ) {
45
 
46
 
46
 		Judge judge = new Judge(name);
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
 import org.springframework.web.bind.annotation.RequestParam;
6
 import org.springframework.web.bind.annotation.RequestParam;
7
 import org.springframework.web.bind.annotation.RestController;
7
 import org.springframework.web.bind.annotation.RestController;
8
 
8
 
9
+import dao.connection.LuceneConnector;
9
 import dao.entity.Lawyer;
10
 import dao.entity.Lawyer;
10
 import dao.lucene.tables.DAOLawyer;
11
 import dao.lucene.tables.DAOLawyer;
11
 
12
 
26
 	@RequestMapping("/lawyer/{id}")
27
 	@RequestMapping("/lawyer/{id}")
27
 	public Lawyer getById(@PathVariable Integer id ) {
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
 		return lawyer;
31
 		return lawyer;
31
 
32
 
32
 	}
33
 	}
35
 	public Lawyer getByName(@RequestParam (required = true) String name ) {
36
 	public Lawyer getByName(@RequestParam (required = true) String name ) {
36
 
37
 
37
 		Lawyer lawyer = new Lawyer(name);
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
 import org.springframework.web.bind.annotation.RequestParam;
9
 import org.springframework.web.bind.annotation.RequestParam;
10
 import org.springframework.web.bind.annotation.RestController;
10
 import org.springframework.web.bind.annotation.RestController;
11
 
11
 
12
-
12
+import dao.connection.LuceneConnector;
13
 import dao.entity.DOProcess;
13
 import dao.entity.DOProcess;
14
 import dao.entity.Entity;
14
 import dao.entity.Entity;
15
+import dao.lucene.search.DAOSearch;
15
 import dao.lucene.tables.DAOProcess;
16
 import dao.lucene.tables.DAOProcess;
16
 
17
 
17
 @RestController
18
 @RestController
32
 	/**returns lawyer by id*/
33
 	/**returns lawyer by id*/
33
 
34
 
34
 	@RequestMapping("/process/{id}")
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
 		return process;
39
 		return process;
39
 
40
 
40
 	}
41
 	}
46
 			daoProcess = Database.get().getDaoProcess();
47
 			daoProcess = Database.get().getDaoProcess();
47
 		
48
 		
48
 		System.out.println("DAOPROCESS " +daoProcess);
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
 		return process;
52
 		return process;
52
 
53
 
60
 		Entity entity = new Entity();
61
 		Entity entity = new Entity();
61
 		entity.setId(entityId);
62
 		entity.setId(entityId);
62
 		entity.setType(type);
63
 		entity.setType(type);
63
-		return daoSearch.search(entity, false, processId);
64
+		return daoSearch.search(entity);
64
 
65
 
65
 	}
66
 	}
66
 
67
 
70
 											  	@RequestParam (required = false, defaultValue= "0") Integer processId   ) 
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
 		searchResults.sort(new Comparator<DOProcess>() {
76
 		searchResults.sort(new Comparator<DOProcess>() {
76
 
77
 

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

7
 import org.springframework.web.bind.annotation.RequestParam;
7
 import org.springframework.web.bind.annotation.RequestParam;
8
 import org.springframework.web.bind.annotation.RestController;
8
 import org.springframework.web.bind.annotation.RestController;
9
 
9
 
10
-
10
+import dao.connection.LuceneConnector;
11
 import dao.entity.Entity;
11
 import dao.entity.Entity;
12
 import dao.entity.Info;
12
 import dao.entity.Info;
13
 import dao.entity.Judge;
13
 import dao.entity.Judge;
14
 import dao.entity.Lawyer;
14
 import dao.entity.Lawyer;
15
+import dao.lucene.search.DAOSearch;
15
 import dao.lucene.tables.DAOEntity;
16
 import dao.lucene.tables.DAOEntity;
16
 import dao.lucene.tables.DAOJudge;
17
 import dao.lucene.tables.DAOJudge;
17
 import dao.lucene.tables.DAOLawyer;
18
 import dao.lucene.tables.DAOLawyer;
54
 		Entity entity = new Entity();
55
 		Entity entity = new Entity();
55
 		entity.setName(text);
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
 			return lawyer;
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
 			return judge;
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
 			return entity;
72
 			return entity;
72
 		}
73
 		}
73
 		return new Entity();
74
 		return new Entity();

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

3
 import java.sql.Connection;
3
 import java.sql.Connection;
4
 
4
 
5
 import dao.connection.Connector;
5
 import dao.connection.Connector;
6
+import dao.lucene.search.DAOSearch;
6
 import dao.lucene.tables.DAOEntity;
7
 import dao.lucene.tables.DAOEntity;
7
 import dao.lucene.tables.DAOJudge;
8
 import dao.lucene.tables.DAOJudge;
8
 import dao.lucene.tables.DAOLawyer;
9
 import dao.lucene.tables.DAOLawyer;