1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.dao.proxy; |
17 | |
|
18 | |
import org.kuali.rice.core.framework.persistence.jpa.OrmUtils; |
19 | |
import org.kuali.rice.kns.bo.DocumentHeader; |
20 | |
import org.kuali.rice.kns.dao.DocumentHeaderDao; |
21 | |
|
22 | 0 | public class DocumentHeaderDaoProxy implements DocumentHeaderDao { |
23 | |
private DocumentHeaderDao documentHeaderDaoJpa; |
24 | |
private DocumentHeaderDao documentHeaderDaoOjb; |
25 | |
|
26 | |
private DocumentHeaderDao getDao(Class clazz) { |
27 | 0 | final String TMP_NM = clazz.getName(); |
28 | 0 | final int START_INDEX = TMP_NM.indexOf('.', TMP_NM.indexOf('.') + 1) + 1; |
29 | 0 | return (OrmUtils.isJpaAnnotated(clazz) && (OrmUtils.isJpaEnabled() || OrmUtils.isJpaEnabled("rice.kns"))) ? |
30 | |
documentHeaderDaoJpa : documentHeaderDaoOjb; |
31 | |
} |
32 | |
|
33 | |
public DocumentHeader getByDocumentHeaderId(String id) { |
34 | 0 | return getDao(DocumentHeader.class).getByDocumentHeaderId(id); |
35 | |
} |
36 | |
|
37 | |
public Class getDocumentHeaderBaseClass() { |
38 | 0 | return getDao(DocumentHeader.class).getDocumentHeaderBaseClass(); |
39 | |
} |
40 | |
|
41 | |
public void setDocumentHeaderDaoJpa(DocumentHeaderDao documentHeaderDaoJpa) { |
42 | 0 | this.documentHeaderDaoJpa = documentHeaderDaoJpa; |
43 | 0 | } |
44 | |
|
45 | |
public void setDocumentHeaderDaoOjb(DocumentHeaderDao documentHeaderDaoOjb) { |
46 | 0 | this.documentHeaderDaoOjb = documentHeaderDaoOjb; |
47 | 0 | } |
48 | |
|
49 | |
} |