Examples of EntityStoreException


Examples of org.qi4j.spi.entitystore.EntityStoreException

                        recordManager.delete( stateIndex );
                        index.remove( ref.toString().getBytes( "UTF-8" ) );
                    }
                    catch( IOException e )
                    {
                        throw new EntityStoreException( e );
                    }
                }
            } );

            recordManager.commit();
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

            return new StringReader( jsonState );

        }
        catch( RiakRetryFailedException ex )
        {
            throw new EntityStoreException( "Unable to get Entity " + entityReference.identity(), ex );
        }
    }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

                                super.close();
                                bucket.store( ref.identity(), toString() ).execute();
                            }
                            catch( RiakException ex )
                            {
                                throw new EntityStoreException( "Unable to apply entity change: newEntity", ex );
                            }
                        }

                    };
                }

                @Override
                public Writer updateEntity( final EntityReference ref, EntityDescriptor entityDescriptor )
                    throws IOException
                {
                    return new StringWriter( 1000 )
                    {

                        @Override
                        public void close()
                            throws IOException
                        {
                            try
                            {
                                super.close();
                                IRiakObject entity = bucket.fetch( ref.identity() ).execute();
                                if( entity == null )
                                {
                                    throw new EntityNotFoundException( ref );
                                }
                                bucket.store( ref.identity(), toString() ).execute();
                            }
                            catch( RiakException ex )
                            {
                                throw new EntityStoreException( "Unable to apply entity change: updateEntity", ex );
                            }
                        }

                    };
                }

                @Override
                public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
                    throws EntityNotFoundException
                {
                    try
                    {
                        IRiakObject entity = bucket.fetch( ref.identity() ).execute();
                        if( entity == null )
                        {
                            throw new EntityNotFoundException( ref );
                        }
                        bucket.delete( ref.identity() ).execute();
                    }
                    catch( RiakException ex )
                    {
                        throw new EntityStoreException( "Unable to apply entity change: removeEntity", ex );
                    }
                }

            } );

        }
        catch( RiakRetryFailedException ex )
        {
            throw new EntityStoreException( "Unable to apply entity changes.", ex );
        }
    }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

                                receiver.receive( new StringReader( jsonState ) );
                            }
                        }
                        catch( RiakException ex )
                        {
                            throw new EntityStoreException( "Unable to apply entity changes.", ex );
                        }
                    }

                } );
            }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

         }
         byte[] serializedState = versioned.getValue();
         return new StringReader(new String(serializedState, "UTF-8"));
      } catch (IOException e)
      {
         throw new EntityStoreException(e);
      }
   }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

                return valueSerialization.deserialize( persistentProperty.valueType(), prop.toString() );
            }
        }
        catch( ValueSerializationException e )
        {
            throw new EntityStoreException( e );
        }
    }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

            }
            setUpdated();
        }
        catch( ValueSerializationException e )
        {
            throw new EntityStoreException( e );
        }
    }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

                return valueSerialization.deserialize( descriptor.valueType(), json.toString() );
            }
        }
        catch( ValueSerializationException | JSONException e )
        {
            throw new EntityStoreException( e );
        }
    }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

            state.getJSONObject( JSONKeys.PROPERTIES ).put( stateName.name(), jsonValue );
            markUpdated();
        }
        catch( ValueSerializationException | JSONException e )
        {
            throw new EntityStoreException( e );
        }
    }
View Full Code Here

Examples of org.qi4j.spi.entitystore.EntityStoreException

                                    : EntityReference.parseEntityReference( (String) jsonValue );
            return value;
        }
        catch( JSONException e )
        {
            throw new EntityStoreException( e );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.