Subversion Repositories SmartDukaan

Rev

Rev 22067 | Rev 22384 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22067 Rev 22162
Line 1... Line 1...
1
package com.spice.profitmandi.dao.util;
1
package com.spice.profitmandi.dao.util;
2
 
2
 
-
 
3
import org.springframework.beans.factory.annotation.Autowired;
-
 
4
import org.springframework.stereotype.Component;
-
 
5
 
3
import com.google.gson.Gson;
6
import com.google.gson.Gson;
4
import com.spice.profitmandi.dao.model.ContentPojo;
7
import com.spice.profitmandi.dao.model.ContentPojo;
5
import com.spice.profitmandi.dao.model.ProductPojo;
8
import com.spice.profitmandi.dao.model.ProductPojo;
6
import com.spice.profitmandi.dao.repository.dtr.Mongo;
9
import com.spice.profitmandi.dao.repository.dtr.Mongo;
7
 
10
 
8
 
11
 
-
 
12
@Component
9
public class ContentPojoPopulator {
13
public class ContentPojoPopulator {
10
 
14
 
11
	private static final Gson gs = new Gson();
15
	private static final Gson gs = new Gson();
12
 
16
 
-
 
17
 
-
 
18
	@Autowired
-
 
19
	Mongo mongoClient;
-
 
20
	
13
	public static ProductPojo getShortContent(long entityId) {
21
	public ProductPojo getShortContent(long entityId) {
14
		ContentPojo cp=null;
22
		ContentPojo cp=null;
15
		ProductPojo pp = null;
23
		ProductPojo pp = null;
16
		try {
24
		try {
17
			cp = gs.fromJson(Mongo.getEntityById(entityId).toString(), ContentPojo.class);
25
			cp = gs.fromJson(mongoClient.getEntityById(entityId).toString(), ContentPojo.class);
18
		} catch (Exception e) {
26
		} catch (Exception e) {
19
			e.printStackTrace();
27
			e.printStackTrace();
20
			return null;
28
			return null;
21
		}
29
		}
22
		try {
30
		try {