Package org.qi4j.spi.entitystore

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


            return new StringReader( jsonState );

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

                                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

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

                } );
            }
View Full Code Here

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

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

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

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

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

                                    : EntityReference.parseEntityReference( (String) jsonValue );
            return value;
        }
        catch( JSONException e )
        {
            throw new EntityStoreException( e );
        }
    }
View Full Code Here

TOP

Related Classes of org.qi4j.spi.entitystore.EntityStoreException

Copyright © 2018 www.massapicom. 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.