Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standart column types, foreign keys, default constructor in Kotlin #1463

Closed
Aqluse opened this issue Oct 15, 2017 · 2 comments
Closed

Standart column types, foreign keys, default constructor in Kotlin #1463

Aqluse opened this issue Oct 15, 2017 · 2 comments

Comments

@Aqluse
Copy link

Aqluse commented Oct 15, 2017

DBFlow Version: 4.1.1
Issue Kind (Bug, Question, Feature): Bug, Question

Description:
I'm using Kotlin to create database
I've got 3 issues (don't know if I should separate them).

1. Standart column types.
I use ByteArray type in a table. I got:

Error:error: Columns cannot be of array type.

But 3rd item allows it:
16-10-2017 001357
https://agrosner.gitbooks.io/dbflow/content/TypeConverters.html

2. Non-nullable Foreign Key

Error:error: ========== :Foreign Keys must be nullable. Please remove the non-null annotation if using Java, or add ? to the type for Kotlin.==========

Is it really such a problem to have non-nullable foreign key?

UPD: As I took a point, after reading some of the same issues had been asked here before, I should put @nonnull annotation instead of non-nullable Kotlin type to see right behavior of this.

3. Default constructor for data class*

Error:error: *==========class com.raizlabs.android.dbflow.processor.TableValidator :Table XXXX must provide a visible, default constructor.==========

I have data classes for all tables in database with column as parameters. Looks like one's in example
https://agrosner.gitbooks.io/dbflow/content/KotlinSupport.html
Got errors for all of tables.

@agrosner
Copy link
Owner

please file 3 separate issues.

  1. that's a bug.
  2. see changes to foreign keys in 4.1 #1459
  3. Make sure you provide default values for all fields.

@agrosner
Copy link
Owner

  1. is in develop now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants