Example usage for javax.resource ResourceException ResourceException

List of usage examples for javax.resource ResourceException ResourceException

Introduction

In this page you can find the example usage for javax.resource ResourceException ResourceException.

Prototype

public ResourceException() 

Source Link

Document

Constructs a new instance with null as its detail message.

Usage

From source file:eu.devexpert.orient.jca.OrientDBGraphImpl.java

public ODocument saveNode(Object obj) throws ResourceException {
    try {//from www .ja va 2s .  c o  m
        ODocument node = createVertex(obj.getClass().getName());
        String jsonStr = mapper.writeValueAsString(obj);
        log.info("Save POJO : " + jsonStr);
        return node.fromJSON(jsonStr).save();
    } catch (IOException iox) {
        throw new ResourceException();
    }
}

From source file:eu.devexpert.orient.jca.OrientDBGraphImpl.java

public <T> T getNodeById(Class<T> clazz, Long id) throws ResourceException {
    try {/*from w ww.  j  a  v a2 s  . c o  m*/
        String jsonStr = getNodeByField(clazz.getName(), "id", id).toJSON();
        log.info("Get POJO by id : " + jsonStr);
        return mapper.readValue(jsonStr, clazz);
    } catch (IOException e) {
        throw new ResourceException();
    }
}

From source file:eu.devexpert.orient.jca.OrientDBGraphImpl.java

@Override
public <T> T getNodeByField(Class<T> clazz, String field, Object value) throws ResourceException {
    try {//w w w .  j  a  va2 s .c  o  m
        String jsonStr = getNodeByField(clazz.getName(), field, value).toJSON();
        log.info("Get POJO by field : " + jsonStr);
        return mapper.readValue(jsonStr, clazz);
    } catch (IOException e) {
        throw new ResourceException();
    }
}