X Tutup
Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

@Transactional does not accept array or parameterized parameters #133

@mathieuboniface

Description

@mathieuboniface

Using @Transactional is not possible if method take array parameters or parametrized parameters. This use of @Transactionalcauses compilation errors on generated code.

This code :

    @Transactional
    void mehodUsingArrayParameters(SQLiteDatabase db, //
            MySerializableBean[] parameters) {
        // do some stuff here
    }

generates wrong import statement :

import com.googlecode.androidannotations.test15.instancestate.MySerializableBean[];

Using parametrized type, this code :

    @Transactional
    void mehodUsingParametrizedParameters(SQLiteDatabase db, //
            List<MySerializableBean> parameters) {
        // do some stuff here
    }

generates wrong import statement :

import java.util.List<com.googlecode.androidannotations.test15.instancestate.MySerializableBean>;

and wrong overriding method :

@Override
    public void mehodUsingParametrizedParameters(SQLiteDatabase db, MySerializableBean>parameters) {
        db.beginTransaction();
        try {
            super.mehodUsingParametrizedParameters(db, parameters);
            db.setTransactionSuccessful();
            return ;
        } catch (RuntimeException e) {
            Log.e("TransactionalActivity_", "Error in transaction", e);
            throw e;
        } finally {
            db.endTransaction();
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup