Skip to content

Instantly share code, notes, and snippets.

@MwBakker
Last active February 6, 2019 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MwBakker/12f93b6d99b6ddaea78a6feefe4aa86c to your computer and use it in GitHub Desktop.
Save MwBakker/12f93b6d99b6ddaea78a6feefe4aa86c to your computer and use it in GitHub Desktop.
@Entity(tableName = "rack_table")
@ForeignKey(
entity = Storage.class,
parentColumns = "storage_id",
childColumns = "rack_id",
onDelete = ForeignKey.CASCADE,
onUpdate = ForeignKey.CASCADE
)
public class Rack
{
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "rack_id")
public long rackID;
@ColumnInfo(name = "storage_id")
public long storageID;
/// ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment