1 23 package com.sun.enterprise.deployment; 24 25 import java.util.Map ; 26 import java.util.HashMap ; 27 28 import javax.persistence.PersistenceContextType; 29 30 import com.sun.enterprise.deployment.types.EntityManagerReference; 31 32 37 public class EntityManagerReferenceDescriptor extends 38 EnvironmentProperty implements EntityManagerReference { 39 40 private String unitName = null; 41 private PersistenceContextType contextType = PersistenceContextType.TRANSACTION; 42 private BundleDescriptor referringBundle; 43 44 private Map <String , String > properties = new HashMap <String ,String >(); 45 46 public EntityManagerReferenceDescriptor(String name, 47 String unitName, 48 PersistenceContextType type) { 49 super(name, "", ""); 50 51 this.unitName = unitName; 52 this.contextType = type; 53 } 54 55 public EntityManagerReferenceDescriptor() {} 56 57 public void setUnitName(String unitName) { 58 59 this.unitName = unitName; 60 } 61 62 public String getUnitName() { 63 64 return unitName; 65 66 } 67 68 public String getInjectResourceType() { 69 return "javax.persistence.EntityManager"; 70 } 71 72 public void setInjectResourceType(String resourceType) { 73 } 74 75 public void setPersistenceContextType(PersistenceContextType type) { 76 77 contextType = type; 78 79 } 80 81 public PersistenceContextType getPersistenceContextType() { 82 83 return contextType; 84 85 } 86 87 public void addProperty(String name, String value) { 88 properties.put(name, value); 89 } 90 91 public Map <String ,String > getProperties() { 92 return new HashMap <String ,String >(properties); 93 } 94 95 public void setReferringBundleDescriptor(BundleDescriptor referringBundle) 96 { 97 this.referringBundle = referringBundle; 98 } 99 100 public BundleDescriptor getReferringBundleDescriptor() 101 { 102 return referringBundle; 103 } 104 105 } 106 107 | Popular Tags |