Bug or Feature Request: APT randomly picks @TypeConverter, when there's ambiguity random choice is not good. The build should fail with a list of conflicting converters and let the user choose by removing the @TypeConverter annotations from all but one of the converters where the type signature matches.
Description:
Not sure if it's reproducible in latest, but in our version having two classes
class Instant { ... }
@com.raizlabs.android.dbflow.annotation.TypeConverter
public class InstantDatabaseConverter extends TypeConverter<String, Instant> { }
@com.raizlabs.android.dbflow.annotation.TypeConverter
public class InstantOtherDatabaseConverter extends TypeConverter<String, Instant> { }
means that any implicitly converted entity columns will pick a random global converter:
@Table(database = SomethingDatabase.class, name = SomethingEntity.TABLE_NAME)
public class SomethingEntity extends BaseModel {
public static final String TABLE_NAME = "Something";
@Column
public Instant createdAt;
}
public final class GeneratedDatabaseHolder extends DatabaseHolder {
public GeneratedDatabaseHolder() {
// this will change with each build
typeConverters.put(Instant.class, new Instant[Other]DatabaseConverter());
}
}
Note: if you specify type converter on the column
@Column(typeConverter = InstantOtherDatabaseConverter.class)
public Instant createdAt;
ISSUE_TEMPLATE
DBFlow Version: 3.3.1
Bug or Feature Request: APT randomly picks
@TypeConverter
, when there's ambiguity random choice is not good. The build should fail with a list of conflicting converters and let the user choose by removing the@TypeConverter
annotations from all but one of the converters where the type signature matches.See for example how Dagger deals with this: https://stackoverflow.com/questions/48534084/dagger-2-viewmodelprovider-factory-bound-multiple-times
Description: Not sure if it's reproducible in latest, but in our version having two classes
means that any implicitly converted entity columns will pick a random global converter:
Note: if you specify type converter on the column
will not be random, as it's explicit.