Search in sources :

Example 1 with NoSuchPropertyException

use of jp.ossc.nimbus.beans.NoSuchPropertyException in project nimbus by nimbus-org.

the class DefaultPersistentManagerService method setResultSetProperties.

private void setResultSetProperties(ResultSet rs, Map resultSetProps) throws PersistentException {
    if (resultSetProps == null || resultSetProps.size() == 0) {
        return;
    }
    try {
        Iterator entries = resultSetProps.entrySet().iterator();
        while (entries.hasNext()) {
            Map.Entry entry = (Map.Entry) entries.next();
            propertyAccess.set(rs, (String) entry.getKey(), entry.getValue());
        }
    } catch (NoSuchPropertyException e) {
        throw new PersistentException("ResultSet property set error.", e);
    } catch (InvocationTargetException e) {
        throw new PersistentException("ResultSet property set error.", e.getTargetException());
    }
}
Also used : Iterator(java.util.Iterator) NoSuchPropertyException(jp.ossc.nimbus.beans.NoSuchPropertyException) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with NoSuchPropertyException

use of jp.ossc.nimbus.beans.NoSuchPropertyException in project nimbus by nimbus-org.

the class MappedPropertyTest method testParse3.

public void testParse3() throws Exception {
    MappedProperty prop = new MappedProperty();
    prop.parse("mapped2(fuga)");
    Test test = new Test();
    try {
        prop.getProperty(test);
        fail();
    } catch (NoSuchPropertyException e) {
    }
}
Also used : MappedProperty(jp.ossc.nimbus.beans.MappedProperty) NoSuchPropertyException(jp.ossc.nimbus.beans.NoSuchPropertyException)

Example 3 with NoSuchPropertyException

use of jp.ossc.nimbus.beans.NoSuchPropertyException in project nimbus by nimbus-org.

the class NestedPropertyTest method testParse3.

public void testParse3() throws Exception {
    NestedProperty prop = new NestedProperty();
    prop.parse("test2.simple");
    Test test = new Test(new Test());
    try {
        prop.getProperty(test);
        fail();
    } catch (NoSuchPropertyException e) {
    }
}
Also used : NoSuchPropertyException(jp.ossc.nimbus.beans.NoSuchPropertyException) NestedProperty(jp.ossc.nimbus.beans.NestedProperty)

Example 4 with NoSuchPropertyException

use of jp.ossc.nimbus.beans.NoSuchPropertyException in project nimbus by nimbus-org.

the class NestedPropertyTest method testParse2.

public void testParse2() throws Exception {
    NestedProperty prop = new NestedProperty();
    prop.parse("test.simple2");
    Test test = new Test(new Test());
    try {
        prop.setProperty(test, "hoge");
        fail();
    } catch (NoSuchPropertyException e) {
    }
}
Also used : NoSuchPropertyException(jp.ossc.nimbus.beans.NoSuchPropertyException) NestedProperty(jp.ossc.nimbus.beans.NestedProperty)

Example 5 with NoSuchPropertyException

use of jp.ossc.nimbus.beans.NoSuchPropertyException in project nimbus by nimbus-org.

the class SimplePropertyTest method testParse2.

public void testParse2() throws Exception {
    SimpleProperty prop = new SimpleProperty();
    prop.parse("simple2");
    Test test = new Test();
    try {
        prop.setProperty(test, "hoge");
        fail();
    } catch (NoSuchPropertyException e) {
    }
}
Also used : NoSuchPropertyException(jp.ossc.nimbus.beans.NoSuchPropertyException) SimpleProperty(jp.ossc.nimbus.beans.SimpleProperty)

Aggregations

NoSuchPropertyException (jp.ossc.nimbus.beans.NoSuchPropertyException)27 InvocationTargetException (java.lang.reflect.InvocationTargetException)18 Map (java.util.Map)13 HashMap (java.util.HashMap)11 Iterator (java.util.Iterator)11 Property (jp.ossc.nimbus.beans.Property)8 RecordList (jp.ossc.nimbus.beans.dataset.RecordList)7 LinkedHashMap (java.util.LinkedHashMap)6 List (java.util.List)6 ArrayList (java.util.ArrayList)5 NestedProperty (jp.ossc.nimbus.beans.NestedProperty)5 SQLException (java.sql.SQLException)4 SimpleProperty (jp.ossc.nimbus.beans.SimpleProperty)4 DataSet (jp.ossc.nimbus.beans.dataset.DataSet)4 Record (jp.ossc.nimbus.beans.dataset.Record)4 ParameterMetaData (java.sql.ParameterMetaData)3 ResultSet (java.sql.ResultSet)3 ResultSetMetaData (java.sql.ResultSetMetaData)3 IndexedProperty (jp.ossc.nimbus.beans.IndexedProperty)3 PropertyEditor (java.beans.PropertyEditor)2