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

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();
        }
    }

Activity

  1. mathieuboniface commented on Mar 10, 2012

    @mathieuboniface
    ContributorAuthor

    I made a pull request, can someone review my fix on that issue ?

  2. tbruyelle commented on Nov 27, 2012

    @tbruyelle
    Contributor

    Is that issue really fixed for all situation?

    I'm currently having the same error in the generated code of my @Rest interface because I'm using parameterized type in a ResponseEntity.

     @Get( "/timeline" )
        ResponseEntity<Response<Timeline>> timeline();

    produce some invalid import in the generated class :

    import com.bistri.prace.model.Response<com.bistri.prace.model.Timeline>;
  3. pyricau commented on Nov 27, 2012

    @pyricau
    Contributor

    @tbruyelle This should be handled by #330 when it's finished :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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