requery - modern SQL based query & persistence for Java / Kotlin / Android

Overview

requery

A light but powerful object mapping and SQL generator for Java/Kotlin/Android with RxJava and Java 8 support. Easily map to or create databases, perform queries and updates from any platform that uses Java.

Build Status Download

Examples

Define entities from an abstract class:

@Entity
abstract class AbstractPerson {

    @Key @Generated
    int id;

    @Index("name_index")                     // table specification
    String name;

    @OneToMany                               // relationships 1:1, 1:many, many to many
    Set<Phone> phoneNumbers;

    @Converter(EmailToStringConverter.class) // custom type conversion
    Email email;

    @PostLoad                                // lifecycle callbacks
    void afterLoad() {
        updatePeopleList();
    }
    // getter, setters, equals & hashCode automatically generated into Person.java
}

or from an interface:

@Entity
public interface Person {

    @Key @Generated
    int getId();

    String getName();

    @OneToMany
    Set<Phone> getPhoneNumbers();

    String getEmail();
}

or use immutable types such as those generated by @AutoValue:

@AutoValue
@Entity
abstract class Person {

    @AutoValue.Builder
    static abstract class Builder {
        abstract Builder setId(int id);
        abstract Builder setName(String name);
        abstract Builder setEmail(String email);
        abstract Person build();
    }

    static Builder builder() {
        return new AutoValue_Person.Builder();
    }

    @Key
    abstract int getId();

    abstract String getName();
    abstract String getEmail();
}

(Note some features will not be available when using immutable types, see here)

Queries: dsl based query that maps to SQL

Result<Person> query = data
    .select(Person.class)
    .where(Person.NAME.lower().like("b%")).and(Person.AGE.gt(20))
    .orderBy(Person.AGE.desc())
    .limit(5)
    .get();

Relationships: represent relations more efficiently with Java 8 Streams, RxJava Observables or plain iterables. (sets and lists are supported to)

@Entity
abstract class AbstractPerson {

    @Key @Generated
    int id;

    @ManyToMany
    Result<Group> groups;
    // equivalent to:
    // data.select(Group.class)
    // .join(Group_Person.class).on(Group_ID.equal(Group_Person.GROUP_ID))
    // .join(Person.class).on(Group_Person.PERSON_ID.equal(Person.ID))
    // .where(Person.ID.equal(id))
}

Kotlin specific support using property references and infix functions:

data {
    val result = select(Person::class) where (Person::age gt 21) and (Person::name eq "Bob") limit 10
}

Java 8 streams:

data.select(Person.class)
    .orderBy(Person.AGE.desc())
    .get()
    .stream().forEach(System.out::println);

Java 8 optional and time support:

public interface Person {

    @Key @Generated
    int getId();

    String getName();
    Optional<String> getEmail();
    ZonedDateTime getBirthday();
}

RxJava Observables:

Observable<Person> observable = data
    .select(Person.class)
    .orderBy(Person.AGE.desc())
    .get()
    .observable();

RxJava observe query on table changes:

Observable<Person> observable = data
    .select(Person.class)
    .orderBy(Person.AGE.desc())
    .get()
    .observableResult().subscribe(::updateFromResult);

Read/write separation Along with immutable types optionally separate queries (reading) and updates (writing):

int rows = data.update(Person.class)
    .set(Person.ABOUT, "student")
    .where(Person.AGE.lt(21)).get().value();

Features

  • No Reflection
  • Fast startup & performance
  • No dependencies (RxJava is optional)
  • Typed query language
  • Table generation
  • Supports JDBC and most popular databases (MySQL, Oracle, SQL Server, Postgres and more)
  • Supports Android (SQLite, RecyclerView, Databinding, SQLCipher)
  • Blocking and non-blocking API
  • Partial objects/refresh
  • Upsert support
  • Caching
  • Lifecycle callbacks
  • Custom type converters
  • Compile time entity validation
  • JPA annotations (however requery is not a JPA provider)

Reflection free

requery uses compile time annotation processing to generate entity model classes and mapping attributes. On Android this means you get about the same performance reading objects from a query as if it was populated using the standard Cursor and ContentValues API.

Query with Java

The compiled classes work with the query API to take advantage of compile time generated attributes. Create type safe queries and avoid hard to maintain, error prone string concatenated queries.

Relationships

You can define One-to-One, One-to-Many, Many-to-One, and Many-to-Many relations in your models using annotations. Relationships can be navigated in both directions. Of many type relations can be loaded into standard java collection objects or into a more efficient Result type. From a Result easily create a Stream, RxJava Observable, Iterator, List or Map.

Many-to-Many junction tables can be generated automatically. Additionally the relation model is validated at compile time eliminating runtime errors.

vs JPA

requery provides a modern set of interfaces for persisting and performing queries. Some key differences between requery and JPA providers like Hibernate or EclipseLink:

  • Queries maps directly to SQL as opposed to JPQL.
  • Dynamic Queries easily done through a DSL as opposed to the verbose CriteriaQuery API.
  • Uses easily understandable extended/generated code instead of reflection/bytecode weaving for state tracking and member access

Android

Designed specifically with Android support in mind. See requery-android/example for an example Android project using databinding and interface based entities. For more information see the Android page.

Supported Databases

Tested on some of the most popular databases:

  • PostgresSQL (9.1+)
  • MySQL 5.x
  • Oracle 12c+
  • Microsoft SQL Server 2012 or later
  • SQLite (Android or with the xerial JDBC driver)
  • Apache Derby 10.11+
  • H2 1.4+
  • HSQLDB 2.3+

JPA Annotations

A subset of the JPA annotations that map onto the requery annotations are supported. See here for more information.

Upserts

Upserts are generated with the appropriate database specific query statements:

  • Oracle/SQL Server/HSQL: merge into when matched/not matched
  • PostgresSQL: on conflict do update (requires 9.5 or later)
  • MySQL: on duplicate key update

Using it

Versions are available on bintray jcenter / maven central.

repositories {
    jcenter()
}

dependencies {
    compile 'io.requery:requery:1.6.1'
    compile 'io.requery:requery-android:1.6.1' // for android
    annotationProcessor 'io.requery:requery-processor:1.6.1'
}

For information on gradle and annotation processing & gradle see the wiki.

License

Copyright (C) 2019 requery.io

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Is there a way to auto insert/update relationship?

    Is there a way to auto insert/update relationship?

    Let's say, I am using a web api which gives me a list of articles, each article has an author relationship, article is keyed by id, author is keyed by username.

    Now I am trying to do dataStore.insert(articles), this throws unique constraint violation on author username if articles has same author.

    So my question is there a way to auto-detect if the relationship is already existing by the key, then do insert or update accordingly?

    bug question 
    opened by tsunamilx 29
  • Can't get things working on new project.

    Can't get things working on new project.

    I'd love to use your lib for a new personal project, and while I was setting it up, I was never able to get entities generated.

    What am I missing ?

    Project is absolutely empty, only contains the following models.

    Models:

    import android.os.Parcelable;
    
    import java.util.Date;
    
    import io.requery.Entity;
    import io.requery.Generated;
    import io.requery.Index;
    import io.requery.Key;
    import io.requery.ManyToOne;
    import io.requery.Persistable;
    
    @Entity
    public interface ITransaction extends Persistable, Parcelable {
    
        @Key @Generated
        long getId();
    
        float getValue();
    
        String getDescription();
    
        Date getDate();
    
        @ManyToOne
        Category getCategory(); // Expecting generated, or should I reference interface?
    
        @ManyToOne
        Account getFromAccount(); // Expecting generated, or should I reference interface?
    }
    
    @Entity
    public interface IAccount extends Persistable, Parcelable {
    
        @Key
        String getName();
    
        float getCapital();
    }
    
    @Entity
    public interface ICategory extends Persistable, Parcelable {
    
        @Key
        String getName();
    }
    

    Probably usefull info: $ java -version

    java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    
    apply plugin: 'com.neenbedankt.android-apt'
    
    repositories {
        maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.1.1'
        compile 'com.android.support:design:23.1.1'
    
        compile 'io.requery:requery:1.0-SNAPSHOT'
        compile 'io.requery:requery-android:1.0-SNAPSHOT'
        apt 'io.requery:requery-processor:1.0-SNAPSHOT'
    
        compile 'io.reactivex:rxjava:1.1.0'
        compile 'io.reactivex:rxandroid:1.1.0'
        compile 'com.google.dagger:dagger:2.0.2'
        provided 'com.google.dagger:dagger-compiler:2.0.2'
    }
    

    Things I tried with no success:

    • $ gradle clean build
    • $ gradle assemble
    • Invalidate caches and restart Android Studio.
    • Clone requery and compile example.

    Thanks in advance!

    bug 
    opened by GMuniz 25
  • beta 21 one to many build fail

    beta 21 one to many build fail

    Trying to update do beta 21, we have three objects, user, document and collection. Document and collection have user as owner, in document and collection user is defined like this:

    `@ManyToOne User getOwner();
    
     void setOwner(User owner);`
    

    and in User interface we have:

    @OneToMany(mappedBy = "owner") MutableResult<Collection> getOwnedCollections();
    
    @OneToMany(mappedBy = "owner") MutableResult<Document> getOwnedDocuments();
    

    build fails as entity classes are not generated and we get this message:

    /home/dev/projects/app/data/src/main/java/base/android/data/cache/database/Document.java
    Warning:(90, 21) 2 mappings found for: base.android.data.cache.database.DocumentEntity.owner -> base.android.data.cache.database.UserEntity
    /home/dev/projects/app/data/src/main/java/base/android/data/cache/database/CDCollection.java
    Warning:(44, 21) 2 mappings found for: base.android.data.cache.database.CollectionEntity.collectionOwner -> base.android.data.cache.database.UserEntity
    Warning:model has errors code generation may fail
    Warning:2 mappings found for: base.android.data.cache.database.DocumentEntity.documentOwner -> base.android.data.cache.database.UserEntity
    Warning:2 mappings found for: base.android.data.cache.database.CollectionEntity.collectionOwner -> base.android.data.cache.database.UserEntity
    Warning:model has errors code generation may fail
    6 warnings
    
    question 
    opened by miomao656 23
  • ManyToMany not inserted [Jackson serialization]

    ManyToMany not inserted [Jackson serialization]

    Hi,

    I have a question considering the following models. After creating an address and saving it, I create a person and add the previously saved address to its addresses. When saving the person now, no row is inserted into the table person_address. Only when I do an update to the previously created address, the row is inserted. Is there a way to prevent this? As the list of addresses is possibly long, I don't want to do a manual update to every address and add all the persons.

    @Entity
    public abstract class Person {
      @Key
      int id;
    
      String name;
      @ManyToMany
      @JunctionTable
      List<AddressEntity> addresses;
    }
    
    @Entity
    public abstract class Address {
      @Key
      int id;
    
      String street;
      @ManyToMany
      List<PersonEntity> persons;
    }
    

    Creation and inserting:

        AddressEntity address = new AddressEntity();
        address.setId(1);
        address.setStreet("Sesamstreet");
        address.setPersons(new LinkedList<PersonEntity>());
        reactiveEntityStore.insert(address).blockingGet();
        PersonEntity personEntity = new PersonEntity();
        personEntity.setId(2);
        personEntity.setName("Jon Doe");
        List<AddressEntity> addressEntities = new LinkedList<>();
        AddressEntity addressEntity = new AddressEntity();
        addressEntity.setId(1);
        addressEntities.add(address);
        personEntity.setAddresses(addressEntities);
        reactiveEntityStore.insert(personEntity).blockingGet();
    
        //This will cause the row to be inserted in the join table
        address.getPersons().add(personEntity);
        reactiveEntityStore.update(address).blockingGet();
    

    Thanks & regards

    enhancement 
    opened by Agraphie 22
  • Cascade Save cause constraint violation

    Cascade Save cause constraint violation

    I have this relation between 2 of my entities :

    @Entity
    public abstract class AbstractNewsArticle extends StreamItem {
    
        @Key
        String id;
        String title;
        String content;
    
        @OneToMany(mappedBy = "article", cascade = {CascadeAction.DELETE, CascadeAction.NONE})
        Set<Image> imageSet;
    }
    

    and

    @Entity
    public abstract class AbstractImage {
    
        @Key
        @Generated
        int id;
    
        @ManyToOne
        NewsArticle article;
    
        String path;
        String caption;
    }
    

    Updating my NewsAticle (with dataStore.update(article)) cause a cascadeSave on the Image entities, which tries to insert a new NewsArticle with the same id, causing a constraint violation (primary key).

    The Exception is thrown in EntityUpdateOperation.java method execute(final QueryElement<Scalar> query)

    bug 
    opened by rafipanoyan 22
  • Error deserializing Entity classes with Gson

    Error deserializing Entity classes with Gson

    I'm getting an error when I desieralize JSON into my entity classes using Gson. My app fails with a JNI error that says

    JNI DETECTED ERROR IN APPLICATION: can't make objects of type com.-redacted-.model.requery.RequeryUser: 0x12e84980
    

    I have a top level RequeryFeedItem that is composed of a RequeryUser (I am required to use interfaces because I am binding them to layouts using Android Databinding.). The API returns List<RequeryFeedItem>, so that is what I am trying to deserialize.

    @Entity("FeedItemEntity")
    public interface RequeryFeedItem {
        @ForeignKey
        @ManyToOne(cascade = {CascadeAction.DELETE, CascadeAction.SAVE})
        RequeryUser getOwner();
    }
    
    @Entity(name = "UserEntity")
    public interface RequeryUser {
        @Key
        String getId();
    }
    

    @KrzysztofWrobel @npurushe Do either of you have any tips for fixing this issue when integrating Requery with Gson?

    enhancement question 
    opened by austynmahoney 21
  • Multi database compile issues

    Multi database compile issues

    helper

    public class CityReQuery {
    
        public static final String STATE_DB = "state_db";
    
        private static CityReQuery mInstance;
        private SingleEntityStore<Persistable> entityStore;
    
        private CityReQuery() {
        }
    
        public static CityReQuery getInstance() {
            if (mInstance == null) {
                mInstance = new CityReQuery();
            }
            return mInstance;
        }
    
        public SingleEntityStore<Persistable> getEntityStore() {
            return entityStore;
        }
    
        /**
         * Initialize general database on first start
         */
        public void init(Context context) {
            initGeneralDataStore(context);
        }
    
        /**
         * @return {@link EntityDataStore} single instance for the application. <p/> Note if you're
         * using Dagger you can make this part of your application level module returning {@code
         * @Provides @Singleton}.
         */
        private SingleEntityStore<Persistable> initGeneralDataStore(Context context) {
            if (entityStore == null) {
                // override onUpgrade to handle migrating to a new version
    //            DatabaseSource source = new DatabaseSource(context, , Models., STATE_DB, 1);
    //            Configuration configuration = source.getConfiguration();
    //            entityStore = RxSupport.toReactiveStore(new EntityDataStore<>(configuration));
            }
            return entityStore;
        }
    }
    

    helper,

    public class UserReQuery {
    
        public static final String USER_DB = "user_db";
    
        private static UserReQuery mInstance;
        private SingleEntityStore<Persistable> entityStore;
    
        private UserReQuery() {
        }
    
        public static UserReQuery getInstance() {
            if (mInstance == null) {
                mInstance = new UserReQuery();
            }
            return mInstance;
        }
    
        public SingleEntityStore<Persistable> getEntityStore() {
            return entityStore;
        }
    
        /**
         * Initialize general database on first start
         */
        public void init(Context context) {
            initGeneralDataStore(context);
        }
    
        /**
         * @return {@link EntityDataStore} single instance for the application. <p/> Note if you're
         * using Dagger you can make this part of your application level module returning {@code
         * @Provides @Singleton}.
         */
        private SingleEntityStore<Persistable> initGeneralDataStore(Context context) {
            if (entityStore == null) {
                // override onUpgrade to handle migrating to a new version
    //            DatabaseSource source = new DatabaseSource(context, Models., USER_DB, 1);
    //            Configuration configuration = source.getConfiguration();
    //            entityStore = RxSupport.toReactiveStore(new EntityDataStore<>(configuration));
            }
            return entityStore;
        }
    }
    

    user

    
    @Entity(name = UserReQuery.USER_DB)
    public interface User {
    
        @Key
        @Generated
        int getId();
    
        String getName();
    
        void setName(String name);
    
        @ManyToMany(mappedBy = "members")
        Result<Group> getMemberGroups();
    
        @ManyToMany(mappedBy = "admins")
        Result<Group> getAdminGroups();
    
    }
    

    group

    @Entity(name = UserReQuery.USER_DB)
    public interface Group {
    
        @Key
        @Generated
        int getId();
    
        String getName();
    
        void setName(String name);
    
        @JunctionTable(name = "group_members")
        @ManyToMany(mappedBy = "memberGroups")
        Result<User> getMembers();
    
        @JunctionTable(name = "group_admins")
        @ManyToMany(mappedBy = "adminGroups")
        Result<User> getAdmins();
    }
    

    city

    @Entity(name = CityReQuery.STATE_DB)
    public interface City {
    
        @Key
        @Generated
        int getId();
    
        String getPTT();
    
        void setPTT(String ptt);
    
        String getName();
    
        void setName(String name);
    
        @ManyToOne
        State getState();
    
        void setState(State state);
    
        @OneToMany(mappedBy = "city")
        Result<Street> getStreets();
    }
    

    state

    @Entity(name = CityReQuery.STATE_DB)
    public interface State {
    
        @Key
        @Generated
        int getId();
    
        String getPostCode();
    
        void setPostCode(String line1);
    
        String getName();
    
        void setName(String line2);
    
        @OneToMany(mappedBy = "state")
        Result<City> getCities();
    }
    

    street

    @Entity(name = CityReQuery.STATE_DB)
    public interface Street {
    
        @Key
        @Generated
        int getId();
    
        String getName();
    
        void setName(String name);
    
        @ManyToOne
        City getCity();
    
        void setCity(City city);
    
    }
    

    and when i try to compile it throws this stack trace

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:compileDebugJavaWithJavac'.
    > java.lang.IllegalArgumentException: couldn't make a guess for requerytest.user_db
    
    * Try:
    Run with --info or --debug option to get more log output.
    
    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
            at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
            at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
            at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
            at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
            at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
            at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
            at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
            at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
            at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: couldn't make a guess for requerytest.user_db
            at com.sun.tools.javac.main.Main.compile(Main.java:553)
            at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
            at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
            at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:45)
            at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
            at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:101)
            at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
            at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
            at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
            at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
            at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:157)
            at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:139)
            at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93)
            at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:39)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
            at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
            ... 14 more
    Caused by: java.lang.IllegalArgumentException: couldn't make a guess for requerytest.user_db
            at com.squareup.javapoet.Util.checkArgument(Util.java:62)
            at com.squareup.javapoet.ClassName.bestGuess(ClassName.java:149)
            at io.requery.processor.EntityNameResolver.typeNameOf(EntityNameResolver.java:35)
            at io.requery.processor.EntityGenerator.<init>(EntityGenerator.java:108)
            at io.requery.processor.EntityProcessor.process(EntityProcessor.java:114)
            at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
            at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
            at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
            at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
            at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
            at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
            at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
            at com.sun.tools.javac.main.Main.compile(Main.java:523)
            ... 34 more
    
    
    
    bug 
    opened by miomao656 21
  • Project Broken after update android studio and gradle version

    Project Broken after update android studio and gradle version

    hello, I was using requery succesfully after an android tools and gradle update, now can't generate classes: I've tried everything.

    this is my console output after full rebuild:

    ` Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]

    Configuration on demand is an incubating feature. NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to /home/devquilla/Android/Sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

    :clean :app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidDatabindingAdapters131Library :app:prepareComAndroidDatabindingLibrary131Library :app:prepareComAndroidSupportAnimatedVectorDrawable2520Library :app:prepareComAndroidSupportAppcompatV72520Library :app:prepareComAndroidSupportSupportCompat2520Library :app:prepareComAndroidSupportSupportCoreUi2520Library :app:prepareComAndroidSupportSupportCoreUtils2520Library :app:prepareComAndroidSupportSupportFragment2520Library :app:prepareComAndroidSupportSupportMediaCompat2520Library :app:prepareComAndroidSupportSupportV42520Library :app:prepareComAndroidSupportSupportVectorDrawable2520Library :app:prepareIoReactivexRxandroid121Library :app:prepareIoRequeryRequeryAndroid120Library :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig :app:generateDebugResValues :app:generateDebugResources :app:mergeDebugResources :app:dataBindingProcessLayoutsDebug :app:processDebugManifest :app:processDebugResources :app:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareComAndroidSupportTestEspressoEspressoCore222Library :app:prepareComAndroidSupportTestEspressoEspressoIdlingResource222Library :app:prepareComAndroidSupportTestExposedInstrumentationApiPublish05Library :app:prepareComAndroidSupportTestRules05Library :app:prepareComAndroidSupportTestRunner05Library :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest :app:compileDebugAndroidTestRenderscript UP-TO-DATE :app:generateDebugAndroidTestBuildConfig :app:generateDebugAndroidTestResValues :app:generateDebugAndroidTestResources :app:mergeDebugAndroidTestResources :app:processDebugAndroidTestResources :app:generateDebugAndroidTestSources :app:mockableAndroidJar :app:preDebugUnitTestBuild UP-TO-DATE :app:prepareDebugUnitTestDependencies :app:dataBindingExportBuildInfoDebug :app:incrementalDebugJavaCompilationSafeguard :app:javaPreCompileDebug :app:transformClassesAndDataBindingWithDataBindingMergeArtifactsForDebug :app:compileDebugJavaWithJavac /home/devquilla/AndroidStudioProjects/Wayuu/app/build/generated/source/apt/debug/main/zlab/com/wayuu/repository/model/DictionaryEntity.java:235: error: cannot find symbol notifyPropertyChanged(main.zlab.com.wayuu.repository.model.BR.word); ^ symbol: class BR location: package main.zlab.com.wayuu.repository.model /home/devquilla/AndroidStudioProjects/Wayuu/app/build/generated/source/apt/debug/main/zlab/com/wayuu/repository/model/DictionaryEntity.java:246: error: cannot find symbol notifyPropertyChanged(main.zlab.com.wayuu.repository.model.BR.definition); ^ symbol: class BR location: package main.zlab.com.wayuu.repository.model /home/devquilla/AndroidStudioProjects/Wayuu/app/build/generated/source/apt/debug/main/zlab/com/wayuu/repository/model/DictionaryEntity.java:257: error: cannot find symbol notifyPropertyChanged(main.zlab.com.wayuu.repository.model.BR.letra); ^ symbol: class BR location: package main.zlab.com.wayuu.repository.model 3 errors

    FAILED

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 5.578 secs

    `

    also after --info i did notice:

    ` Executing task ':app:compileDebugJavaWithJavac' (up-to-date check took 0.004 secs) due to: No history is available. All input files are considered out-of-date for incremental task ':app:compileDebugJavaWithJavac'. Compiling with source level 1.7 and target level 1.7. file or directory '/home/devquilla/AndroidStudioProjects/Wayuu/app/src/debug/java', not found file or directory '/home/devquilla/AndroidStudioProjects/Wayuu/app/build/generated/source/rs/debug', not found Compiling with JDK Java compiler API.

    `

    Any help would be appreciated.

    bug 
    opened by steelxt 19
  • Transient abstract class methods

    Transient abstract class methods

    Annotating a method with @Transient doesn't prevent custom method generation in the entity.

    @Entity
    public abstract class Data {
      @Key
      @Generated
      abstract long getId();
    
      @Transient
      public Data copy() {
        return null;
      }
    }
    

    Generates this entity:

    public class DataEntity extends Data implements Persistable {
        ...
        
        private Data copy;
    
        @Override
        public Data copy() {
            return this.copy;
        }
    
        public void copy(Data copy) {
            this.copy = copy;
        }
        
        ...
    }
    

    I hoped the method would stay unmodified and no new fields created or does @Transient not work for methods?

    Edit: This kotlin class generates a correct entity:

    @Entity
    abstract class Data {
      @get:Key
      @get:Generated
      abstract val id: Long
    
      @Transient
      fun copy(): Data? {
        return null
      }
    }
    

    However, when it overrides an interface's method it fails just like with a java class:

    interface Copyable {
      fun copy(): Data?
    }
    
    @Entity
    abstract class Data : Copyable {
      @get:Key
      @get:Generated
      abstract val id: Long
    
      @Transient
      override fun copy(): Data? {
        return null
      }
    }
    
    bug 
    opened by absimas 17
  • Android + Jack Compiler: NullPointerException

    Android + Jack Compiler: NullPointerException

    * Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformJackWithJackForProdDebug'.
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
            at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:61)
            at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
            at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
            at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:45)
            at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
            at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
            at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
            at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:233)
            at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:74)
            at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:55)
            at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
            at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    Caused by: java.lang.RuntimeException: com.android.jack.ir.JNodeInternalError: java.lang.Exception: java.lang.NullPointerException
            at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:126)
            at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJackApis(AndroidBuilder.java:1816)
            at com.android.builder.core.AndroidBuilder.convertByteCodeUsingJack(AndroidBuilder.java:1643)
            at com.android.build.gradle.internal.transforms.JackTransform.runJack(JackTransform.java:221)
            at com.android.build.gradle.internal.transforms.JackTransform.transform(JackTransform.java:195)
            at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
            at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
            at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
            at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
            at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
            at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
            at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
            at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
            at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
            ... 15 more
    Caused by: com.android.jack.ir.JNodeInternalError: java.lang.Exception: java.lang.NullPointerException
            at com.android.jack.frontend.java.JAstBuilder.handleInternalException(JAstBuilder.java:252)
            at com.android.jack.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:763)
            at com.android.jack.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:460)
            at com.android.jack.frontend.java.JackBatchCompiler.performCompilation(JackBatchCompiler.java:223)
            at com.android.jack.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1712)
            at com.android.jack.frontend.java.JackBatchCompiler.compile(JackBatchCompiler.java:188)
            at com.android.jack.Jack.buildSession(Jack.java:977)
            at com.android.jack.Jack.run(Jack.java:496)
            at com.android.jack.api.v01.impl.Api01ConfigImpl$Api01CompilationTaskImpl.run(Api01ConfigImpl.java:102)
            ... 29 more
    Caused by: java.lang.Exception: java.lang.NullPointerException
            at com.android.jack.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:169)
            at com.android.jack.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
            at com.android.jack.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
            at com.android.jack.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:909)
            at com.android.jack.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
            ... 35 more
    Caused by: java.lang.NullPointerException
            at io.requery.processor.Mirrors.namesEqual(Mirrors.java:159)
            at io.requery.processor.Mirrors.implementsInterface(Mirrors.java:109)
            at io.requery.processor.Mirrors.isInstance(Mirrors.java:91)
            at io.requery.processor.AttributeMember.validateCollectionType(AttributeMember.java:202)
            at io.requery.processor.AttributeMember.checkMemberType(AttributeMember.java:194)
            at io.requery.processor.AttributeMember.process(AttributeMember.java:147)
            at io.requery.processor.EntityType.lambda$process$5(EntityType.java:114)
            at io.requery.processor.EntityType.process(EntityType.java:114)
            at io.requery.processor.EntityProcessor.process(EntityProcessor.java:147)
            at com.android.jack.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
            ... 39 more
    
    
    BUILD FAILED
    
    bug 
    opened by wa1demar 16
  • Can't compile after adding a Junction Table type.

    Can't compile after adding a Junction Table type.

    I am using requery's release 1.0.0-rc1

    My Entities are like this:

    @Entity abstract class Item implements Parcelable {
      @Key @Generated int id;
    
      @JunctionTable(type = ItemPurchase.class) @ManyToMany List<Purchase> purchases;
    
      long code;
    
      String brand;
    
      String category;
    
      String size;
    
      String description;
    
      float price;
    
      int quantity;
    }
    
    @Entity abstract class Purchase implements Parcelable {
      @Key @Generated int id;
    
      @ManyToMany List<Item> items;
    
      String paymentType;
    
      float totalPrice;
    
      int totalItemQuantityPurchased;
    
      Date purchaseDate;
    }
    
    @Entity abstract class ItemPurchase {
      @ForeignKey(references = Item.class) @Key int itemId;
      @ForeignKey(references = Purchase.class) @Key int itemPurchase;
    
      int itemQuantityPurchased;
    }
    

    Whenever I add:

    @JunctionTable(type = ItemPurchase.class)

    I can't compile my code. When I run with --stacktrace option I get the following message:

    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
        at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:46)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:58)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:48)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: couldn't make a guess for 
        at com.sun.tools.javac.main.Main.compile(Main.java:553)
        at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
        at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:45)
        at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:101)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:50)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:36)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:34)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25)
        at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:157)
        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:139)
        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93)
        at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
        at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
        ... 70 more
    Caused by: java.lang.IllegalArgumentException: couldn't make a guess for 
        at io.requery.com.squareup.javapoet.Util.checkArgument(Util.java:64)
        at io.requery.com.squareup.javapoet.ClassName.bestGuess(ClassName.java:159)
        at io.requery.processor.EntityNameResolver.joinEntityName(EntityNameResolver.java:68)
        at io.requery.processor.EntityGenerator.lambda$generateJunctionType$27(EntityGenerator.java:823)
        at io.requery.processor.EntityGenerator.generateJunctionType(EntityGenerator.java:823)
        at io.requery.processor.EntityGenerator.lambda$generateAttribute$25(EntityGenerator.java:754)
        at io.requery.processor.EntityGenerator.generateAttribute(EntityGenerator.java:749)
        at io.requery.processor.EntityGenerator.lambda$generateStaticMetadata$16(EntityGenerator.java:551)
        at io.requery.processor.EntityGenerator.generateStaticMetadata(EntityGenerator.java:528)
        at io.requery.processor.EntityGenerator.generate(EntityGenerator.java:148)
        at io.requery.processor.EntityProcessor.process(EntityProcessor.java:191)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
        at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
        at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
        at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
        at com.sun.tools.javac.main.Main.compile(Main.java:523)
        ... 90 more
    
    bug 
    opened by ghost 15
  • Migrate from RxJava2 to RxJava3

    Migrate from RxJava2 to RxJava3

    Currently RxJavaBridge is required in our RxJava3 app in order to use requery.

    entityStore.upsert(entity)
            .as(RxJavaBridge.toV3Single())
            ...
    

    Any chance of updating requery to RxJava3? There should be minimal code changes and no logic changes required.

    enhancement 
    opened by Tom-Alphero 0
  • How to create Entity  with a dynamic table name

    How to create Entity with a dynamic table name

    How to create Entity with a dynamic table name ? I need to set different table names depending on environment where my code is running. Like it is in Hibernate .setNamingStrategy( new MyNamingStrategy () );

    opened by yedubi 0
  • connection leak when rollback (reloaded)

    connection leak when rollback (reloaded)

    @npurushe I don't think that https://github.com/requery/requery/issues/628 is solved. In https://github.com/requery/requery/blob/master/requery/src/main/java/io/requery/sql/ConnectionTransaction.java#L168 it 's necessary to call close method, like in commit (see https://github.com/requery/requery/blob/master/requery/src/main/java/io/requery/sql/ConnectionTransaction.java#L150)

    opened by decebals 1
  • how to set an attribute when it is a key generated type?

    how to set an attribute when it is a key generated type?

    Thanks for such a great ORM library. Now I use requery for different OS such as windows, linux, android. It is cool when I put it in GraalVM native environement. It help me a lots to do something quickly and in a lighter way.

    I have a question. If I construct my model by abstract class way, such as,

    abstract class BaseSomething { @Key @Generated int id; }

    I find that the generated Somthing class has no accessor method for setId(int). I think it is a bit confuse especially when I do something, for example I want to construct Somthing with a special id when I do unit testing.

    Can I walk around this limitation?

    Thanks.

    opened by weiyongh 0
  • Possible to create field of Map type?

    Possible to create field of Map type?

    This code fails with NPE, someMap is null

    @get:OneToMany
    val someMap: Map<EntityField, Entity>
    

    can I get this filled on select from DB like mapOf(e.field to e) ? Need to avoid duplicating list to map after select.

    opened by 14v 0
Releases(1.6.0)
Owner
requery
requery
A Java/Kotlin library for Android platform, to manage bean's persistence in SQLite, SharedPreferences, JSON, XML, Properties, Yaml, CBOR.

Thanks to JetBrains for support Kripton Persistence Library project! Kripton Persistence Library Kripton is a java library, for Android platform, that

xcesco 117 Nov 11, 2022
A tool to convert & query Apache Calcite data sources as GraphQL API's

Apache Calcite <-> Distributed, Federated GraphQL API Apache Calcite <-> Distributed, Federated GraphQL API Goals Roadmap and Current Progress The Roa

Gavin Ray 19 Nov 22, 2022
Active record style SQLite persistence for Android

ActiveAndroid ActiveAndroid is an active record style ORM (object relational mapper). What does that mean exactly? Well, ActiveAndroid allows you to s

Michael Pardo 4.7k Dec 29, 2022
Active record style SQLite persistence for Android

ActiveAndroid ActiveAndroid is an active record style ORM (object relational mapper). What does that mean exactly? Well, ActiveAndroid allows you to s

Michael Pardo 4.7k Dec 29, 2022
ORMDroid is a simple ORM persistence framework for your Android applications.

ORMDroid is a simple ORM persistence framework for your Android applications, providing an easy to use, almost-zero-config way to handle model persist

Ross Bamford 87 Nov 10, 2022
Upsert DSL extension for Exposed, Kotlin SQL framework

Exposed Upsert Upsert DSL extension for Exposed, Kotlin SQL framework. Project bases on various solutions provided by community in the official "Expos

Dzikoysk 23 Oct 6, 2022
Upsert DSL extension for Exposed, Kotlin SQL framework

Exposed Upsert Upsert DSL extension for Exposed, Kotlin SQL framework. Project bases on various solutions provided by community in the official "Expos

Reposilite Playground 23 Oct 6, 2022
sql-delight example, a plugin by Square which is pure kotlin and it is useful in kmm

Sql-Delight-Example01 Developed by Mahdi Razzaghi Ghaleh first example of sql-delight What is SqlDelight? Kotlin Multiplatform is one of the most inte

rq_mehdi 0 Jan 24, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
Android library for auto generating SQL schema and Content provider

Android-AnnotatedSQL Android library for auto generating SQL schema and Content Provider by annotations. You will get a full-featured content provider

Gennadiy Dubina 161 Dec 3, 2022
A lightweight wrapper around SQLiteOpenHelper which introduces reactive stream semantics to SQL operations.

SQL Brite A lightweight wrapper around SupportSQLiteOpenHelper and ContentResolver which introduces reactive stream semantics to queries. Deprecated T

Square 4.6k Jan 5, 2023
LiteGo is a Java-based asynchronous concurrency library. It has a smart executor, which can be freely set the maximum number of concurrent at same time , and the number of threads in waiting queue. It can also set waiting policies and overload strategies.

LiteGo:「迷你」的Android异步并发类库 LiteGo是一款基于Java语言的「异步并发类库」,它的核心是一枚「迷你」并发器,它可以自由地设置同一时段的最大「并发」数量,等待「排队」线程数量,还可以设置「排队策略」和「超载策略」。 LiteGo可以直接投入Runnable、Callable

马天宇 189 Nov 10, 2022
To-Do App using Modern Declarative UI Toolkit called Jetpack Compose

Daedalus-Scheduler To-Do App using Modern Declarative UI Toolkit called Jetpack Compose The Brief App that searches recipes from the api spoonacular A

null 0 Jan 6, 2022
Memory objects for Kotlin/JVM and Java

Memoria Why should an object care about where to store their bytes? Examples Basics RAM can used as a memory storage: val ram: BytesMemory = RamMemory

null 6 Jul 29, 2022
lightweight and minimalist ORM for Java/Android. works with SQLite & MySQL. (not actively maintained)

Description ORMAN is an minimalistic and lightweight ORM framework for Java which can handle your common database usage without writing SQL and strugg

Ahmet Alp Balkan 246 Nov 20, 2022
lightweight and minimalist ORM for Java/Android. works with SQLite & MySQL. (not actively maintained)

Description ORMAN is an minimalistic and lightweight ORM framework for Java which can handle your common database usage without writing SQL and strugg

Ahmet Alp Balkan 246 Nov 20, 2022
Android Room with a View - Java

Android Room with a View - Java This code used Room in a database-backed app. You'll create the data layer for an app that tracks Product, and you'll

Khương Hùng 3 Oct 31, 2022
Android SQLite API based on SQLCipher

Download Source and Binaries The latest AAR binary package information can be here, the source can be found here. Compatibility SQLCipher for Android

SQLCipher 2.6k Dec 31, 2022
Starter code for Android Kotlin Fundamentals Codelab 6.1 Room

TrackMySleepQuality - Starter Code Starter code for Android Kotlin Fundamentals Codelab 6.1 Room Introduction TrackMySleepQuality is an app for record

YamanAswal 0 Jan 15, 2022