Package org.datanucleus.store.valuegenerator

Examples of org.datanucleus.store.valuegenerator.ValueGenerationBlock


            }
            if (NucleusLogger.VALUEGENERATION.isDebugEnabled())
            {
                NucleusLogger.VALUEGENERATION.debug(LOCALISER.msg("040004", "" + size));
            }
            return new ValueGenerationBlock(oid);
        }
        catch (SQLException e)
        {
            throw new ValueGenerationException(LOCALISER_RDBMS.msg("061001",e.getMessage()));
        }
View Full Code Here


            }
            if (NucleusLogger.VALUEGENERATION.isDebugEnabled())
            {
                NucleusLogger.VALUEGENERATION.debug(LOCALISER.msg("040004", "" + size));
            }
            return new ValueGenerationBlock(oid);
        }
        catch (SQLException e)
        {
            throw new ValueGenerationException(LOCALISER_RDBMS.msg("061001",e.getMessage()));
        }
View Full Code Here

                {
                    nextId = rs.getString(1);
                    oid.add(nextId);
                }
            }
            return new ValueGenerationBlock(oid);
        }
        catch (SQLException e)
        {
            throw new ValueGenerationException(LOCALISER.msg("040008",e.getMessage()));
        }
View Full Code Here

     * @param number The number of additional ids required
     * @return the PoidBlock
     */
    protected ValueGenerationBlock obtainGenerationBlock(int number)
    {
        ValueGenerationBlock block = null;

        // Try getting the block
        boolean repository_exists=true; // TODO Ultimately this can be removed when "repositoryExists()" is implemented
        try
        {
View Full Code Here

            ps = sqlControl.getStatementForUpdate(connection, stmt, false);

            rs = sqlControl.executeStatementQuery(connection, stmt, ps);
            if (!rs.next())
            {
                return new ValueGenerationBlock(new Object[] { Long.valueOf(1) });
            }

            return new ValueGenerationBlock(new Object[] { Long.valueOf(rs.getLong(1) + 1)});
        }
        catch (SQLException e)
        {
            //TODO adds a message correspondent to the exception.
            //we need to work to create user friendly messages
View Full Code Here

        try
        {
            //TODO must provide the node, and not the root. otherwise the id is always generated with same value
            Object doc = connectionProvider.retrieveConnection().getConnection();
            String id = XPathFactory.newInstance().newXPath().evaluate("generate-id(.)", doc);
            ValueGenerationBlock block = new ValueGenerationBlock(new String[]{id});
            return block;
        }
        catch (Exception e)
        {
            throw new ValueGenerationException(e.getMessage(), e);
View Full Code Here

    List<Long> ids = Utils.newArrayList();
    long current = range.getStart().getId();
    for (int i = 0; i < size; i++) {
      ids.add(current + i);
    }
    return new ValueGenerationBlock(ids);
  }
View Full Code Here

    List<Long> ids = Utils.newArrayList();
    long current = range.getStart().getId();
    for (int i = 0; i < size; i++) {
      ids.add(current + i);
    }
    return new ValueGenerationBlock(ids);
  }
View Full Code Here

    List<Long> ids = Utils.newArrayList();
    long current = range.getStart().getId();
    for (int i = 0; i < size; i++) {
      ids.add(current + i);
    }
    return new ValueGenerationBlock(ids);
  }
View Full Code Here

        finally
        {
            connectionProvider.releaseConnection();
        }

        return new ValueGenerationBlock(oids);
    }
View Full Code Here

TOP

Related Classes of org.datanucleus.store.valuegenerator.ValueGenerationBlock

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.