DBFlow icon indicating copy to clipboard operation
DBFlow copied to clipboard

[3.0.0-beta1] generatedClassSeparator not used in Adapter

Open noinnion opened this issue 10 years ago • 4 comments

generated Adapters don't use generatedClassSeparator defined in @Database

noinnion avatar Dec 19 '15 21:12 noinnion

are you sure? I don't see it happening here.

agrosner avatar Jan 10 '16 03:01 agrosner

@agrosner yeah I am still seeing it

    //// Only load model if references match, for efficiency
    int indexuser_id = cursor.getColumnIndex("user_id");
    if (indexuser_id != -1 && !cursor.isNull(indexuser_id)) {
      model.user = new com.raizlabs.android.dbflow.sql.language.Select().from(de.dynaweb.dynapos.database.model.User.class).where()
          .and(de.dynaweb.dynapos.database.model.User_Table.id.eq(cursor.getInt(indexuser_id))).querySingle();
    }
    //// Only load model if references match, for efficiency
    int indexcustomer_id = cursor.getColumnIndex("customer_id");
    if (indexcustomer_id != -1 && !cursor.isNull(indexcustomer_id)) {
      model.customer = new com.raizlabs.android.dbflow.sql.language.Select().from(de.dynaweb.dynapos.database.model.Customer.class).where()
          .and(de.dynaweb.dynapos.database.model.Customer_Table.id.eq(cursor.getInt(indexcustomer_id))).querySingle();
    }

it should be User$Table.id and Customer$Table.id instead of User_Table.id and Customer_Table.id

gnuhel avatar Jan 19 '16 12:01 gnuhel

I think it is here:

https://github.com/Raizlabs/DBFlow/blob/56f83f4abb0c1d082b8457c4af2d9c66a49a2594/dbflow-processor/src/main/java/com/raizlabs/android/dbflow/processor/definition/column/ForeignKeyColumnDefinition.java#L274

I don't know how to get database to get the classSeperator :(

gnuhel avatar Jan 19 '16 12:01 gnuhel

I'm seeing it too, it only happens if I use ForeignKey. I think @gnuhel pointed to the right place.

lzanita09 avatar Jan 29 '16 18:01 lzanita09