Package org.apache.torque.om

Examples of org.apache.torque.om.SimpleKey


     * @param key
     */
    public void setPrimaryKey(ObjectKey key) throws TorqueException
    {
        SimpleKey[] keys = (SimpleKey[]) key.getValue();
        SimpleKey tmpKey = null;
                             setRoleId(((NumberKey)keys[0]).intValue());
                                setPermissionId(((NumberKey)keys[1]).intValue());
                }
View Full Code Here


     * @param key
     */
    public void setPrimaryKey(ObjectKey key) throws TorqueException
    {
        SimpleKey[] keys = (SimpleKey[]) key.getValue();
        SimpleKey tmpKey = null;
                             setUserId(((NumberKey)keys[0]).intValue());
                                setGroupId(((NumberKey)keys[1]).intValue());
                                setRoleId(((NumberKey)keys[2]).intValue());
                }
View Full Code Here

     * @param key
     */
    public void setPrimaryKey(ObjectKey key) throws TorqueException
    {
        SimpleKey[] keys = (SimpleKey[]) key.getValue();
        SimpleKey tmpKey = null;
                             setRoleId(((NumberKey)keys[0]).intValue());
                                setPermissionId(((NumberKey)keys[1]).intValue());
                }
View Full Code Here

     *         rethrown wrapped into a TorqueException.
     */
    public static ObjectKey doInsert(Criteria criteria, Connection con)
        throws TorqueException
    {
        SimpleKey id = null;

        // Get the table name and method for determining the primary
        // key value.
        String tableName = null;
        Iterator keys = criteria.keySet().iterator();
View Full Code Here

     *         rethrown wrapped into a TorqueException.
     */
    public static ObjectKey doInsert(Criteria criteria, Connection con)
        throws TorqueException
    {
        SimpleKey id = null;

        // Get the table name and method for determining the primary
        // key value.
        String table = null;
        Iterator keys = criteria.keySet().iterator();
View Full Code Here

     * @throws TorqueException Possible errors get wrapped in here.
     */
    private static SimpleKey getId(ColumnMap pk, IdGenerator keyGen, Connection con, Object keyInfo)
            throws TorqueException
    {
        SimpleKey id = null;

        try
        {
            if (pk != null && keyGen != null)
            {
View Full Code Here

     *
     * @throws Exception if the test fails.
     */
    public void testSelectSimpleKeyNullValue() throws Exception
    {
        SimpleKey keyToSelect = SimpleKey.keyFor((Integer) null);
        Criteria criteria = new Criteria()
                .where(BookPeer.ISBN, keyToSelect);

        List<Book> books = BookPeer.doSelect(criteria);
        assertEquals(10, books.size());
View Full Code Here

        Database database = Torque.getDatabase(databaseNameFromInsertValues);
        Object keyInfo = getIdMethodInfo();
        IdGenerator keyGen = database.getIdGenerator(
                getTableMap().getPrimaryKeyMethod());

        SimpleKey id = null;
        // can currently generate only single column pks, therefore a single
        // columnMap is ok
        ColumnMap primaryKey = null;
        if (keyGen != null)
        {
            // fail on multiple pks
            primaryKey = getTableMap().getPrimaryKey();

            // primaryKey will be null if there is no primary key
            // defined for the table we're inserting into.
            if (keyGen.isPriorToInsert() && primaryKey != null
                    && !insertValues.containsKey(
                            primaryKey))
            {
                id = getId(primaryKey, keyGen, connection, keyInfo);
                insertValues.put(
                        primaryKey,
                        new JdbcTypedValue(id.getValue(), id.getJdbcType()));
            }
        }

        List<String> columnNames = new ArrayList<String>();
        List<JdbcTypedValue> replacementObjects
View Full Code Here

                IdGenerator keyGen,
                Connection con,
                Object keyInfo)
            throws TorqueException
    {
        SimpleKey id = null;

        if (pk != null && keyGen != null)
        {
            if (pk.getType() instanceof Number)
            {
View Full Code Here

     *         rethrown wrapped into a TorqueException.
     */
    public static ObjectKey doInsert(Criteria criteria, Connection con)
        throws TorqueException
    {
        SimpleKey id = null;

        // Get the table name and method for determining the primary
        // key value.
        String table = null;
        Iterator keys = criteria.keySet().iterator();
View Full Code Here

TOP

Related Classes of org.apache.torque.om.SimpleKey

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.