/** * Checks if is weaving enabled. * * @return true, if is weaving enabled */ public boolean isWeavingEnabled() { if (this.weavingEnabled == null) { this.weavingEnabled = getWeavingProperty(); } return this.weavingEnabled; }
/** * Instantiates a new persistence context. * * @param emfName the emf name * @param emf the emf * @param defaultURI the default uri * @param version REST service version */ public PersistenceContext(String emfName, EntityManagerFactoryImpl emf, URI defaultURI, ServiceVersion version) { super(); init(emfName, emf, defaultURI, version); }
/** * A part of the facade over the JPA API * Find an entity with the given name and id in JPA * @param tenantId * @param entityName * @param id * @return */ public Object find(Map<String, String> tenantId, String entityName, Object id) { return find(tenantId, entityName, id, null); }
/** * Getter for pageableQueries property with lazy initialization. * * @return The initialized pageableQueries property. */ private Map<String, RestPageableQuery> getPageableQueries() { // Lazy initialization if (pageableQueries == null) { initPageableQueries(); } return pageableQueries; }
/** * A convenience method to create a new dynamic entity of the given type * @param type * @return */ public DynamicEntity newEntity(String type) { return newEntity(null, type); }
/** * Marshall an entity to either JSON or XML. * * @param object * @param mediaType * @param output * @param sendRelationships if this is set to true, relationships will be sent as links instead of sending. * the actual objects in the relationships * @throws JAXBException */ @SuppressWarnings({ "rawtypes", "unchecked" }) public void marshall(Object object, MediaType mediaType, OutputStream output, boolean sendRelationships) throws JAXBException { marshall(object, mediaType, output, sendRelationships, null); }
/** * Process an entity and add any additional data that needs to be added prior to marshalling * This method will both single entities and lists of entities * @param object */ @SuppressWarnings("rawtypes") protected void preMarshallEntity(Object object) { if (object instanceof List) { for (Object o : ((List) object)) { preMarshallIndividualEntity(o); } } else { preMarshallIndividualEntity(object); } }
/** * A part of the facade over the JPA API * Create an EntityManager from the EntityManagerFactory wrapped by this persistence context * @param tenantId * @return */ protected EntityManager createEntityManager(String tenantId) { return getEmf().createEntityManager(); }
/** * Finds out is given query pageable or not. * * @param queryName named query to check. * @return true if pageable, false if not. */ public boolean isQueryPageable(String queryName) { return getPageableQueries().get(queryName) != null; }
/** * Instantiates a new persistence context. * * @param emfName the emf name * @param emf the emf * @param defaultURI the default uri */ public PersistenceContext(String emfName, EntityManagerFactoryImpl emf, URI defaultURI) { super(); init(emfName, emf, defaultURI, ServiceVersion.NO_VERSION); }
/** * A part of the facade over the JPA API * Find an entity with the given name and id in JPA * @param entityName * @param id * @return */ public Object find(String entityName, Object id) { return find(null, entityName, id); }
/** * Checks if is weaving enabled. * * @return true, if is weaving enabled */ public boolean isWeavingEnabled() { if (this.weavingEnabled == null) { this.weavingEnabled = getWeavingProperty(); } return this.weavingEnabled; }
/** * Getter for pageableQueries property with lazy initialization. * * @return The initialized pageableQueries property. */ private Map<String, RestPageableQuery> getPageableQueries() { // Lazy initialization if (pageableQueries == null) { initPageableQueries(); } return pageableQueries; }
/** * A convenience method to create a new dynamic entity of the given type * @param type * @return */ public DynamicEntity newEntity(String type) { return newEntity(null, type); }
/** * Marshall an entity to either JSON or XML. * * @param object * @param mediaType * @param output * @param sendRelationships if this is set to true, relationships will be sent as links instead of sending. * the actual objects in the relationships * @throws JAXBException */ @SuppressWarnings({ "rawtypes", "unchecked" }) public void marshall(Object object, MediaType mediaType, OutputStream output, boolean sendRelationships) throws JAXBException { marshall(object, mediaType, output, sendRelationships, null); }
/** * Process an entity and add any additional data that needs to be added prior to marshalling * This method will both single entities and lists of entities * @param object */ @SuppressWarnings("rawtypes") protected void preMarshallEntity(Object object) { if (object instanceof List) { for (Object o : ((List) object)) { preMarshallIndividualEntity(o); } } else { preMarshallIndividualEntity(object); } }
/** * Instantiates a new persistence context. * * @param emfName the emf name * @param emf the emf * @param defaultURI the default uri * @param version REST service version */ public PersistenceContext(String emfName, EntityManagerFactoryImpl emf, URI defaultURI, ServiceVersion version) { super(); init(emfName, emf, defaultURI, version); }
/** * A part of the facade over the JPA API * Find an entity with the given name and id in JPA * @param tenantId * @param entityName * @param id * @return */ public Object find(Map<String, String> tenantId, String entityName, Object id) { return find(tenantId, entityName, id, null); }
/** * Instantiates a new persistence context. * * @param emfName the emf name * @param emf the emf * @param defaultURI the default uri */ public PersistenceContext(String emfName, EntityManagerFactoryImpl emf, URI defaultURI) { super(); init(emfName, emf, defaultURI, ServiceVersion.NO_VERSION); }
/** * A part of the facade over the JPA API * Find an entity with the given name and id in JPA * @param entityName * @param id * @return */ public Object find(String entityName, Object id) { return find(null, entityName, id); }