Commit 6ceae663 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

refactor db model

parent 7d76b6be
...@@ -41,8 +41,6 @@ interface Estate : Persistable { ...@@ -41,8 +41,6 @@ interface Estate : Persistable {
val info_building: Int val info_building: Int
val info_section_begin: Int val info_section_begin: Int
val info_floor: Int val info_floor: Int
@get:OneToMany(mappedBy = "id")
val explications: Set<Explication>?
val info_floor_max: Int val info_floor_max: Int
@get:Nullable @get:Nullable
val url: String? val url: String?
...@@ -66,4 +64,7 @@ interface Estate : Persistable { ...@@ -66,4 +64,7 @@ interface Estate : Persistable {
val info_ceiling: Float? val info_ceiling: Float?
@get:Nullable @get:Nullable
val info_direction: String? val info_direction: String?
@get:OneToMany(mappedBy = "id", cascade = [CascadeAction.SAVE, CascadeAction.DELETE])
val planPreset: Set<PlanPreset>
} }
\ No newline at end of file
package com.biganto.visual.roompark.data.repository.db.requrey.model package com.biganto.visual.roompark.data.repository.db.requrey.model
import io.requery.* import io.requery.Entity
import io.requery.Generated
import io.requery.Key
import io.requery.Persistable
/** /**
* Created by Vladislav Bogdashkin on 24.09.2019. * Created by Vladislav Bogdashkin on 24.09.2019.
...@@ -11,8 +14,6 @@ interface Explication : Persistable { ...@@ -11,8 +14,6 @@ interface Explication : Persistable {
@get:Key @get:Key
@get:Generated @get:Generated
val id: Int val id: Int
@get:ForeignKey(references = PlanPreset::class)
val planId: Int
val living: Boolean val living: Boolean
val area: Float val area: Float
val title: String val title: String
......
...@@ -20,4 +20,6 @@ interface PlanPreset : Persistable { ...@@ -20,4 +20,6 @@ interface PlanPreset : Persistable {
val title:String val title:String
@get:Convert(StringListConverter::class) @get:Convert(StringListConverter::class)
val features:List<String> val features:List<String>
@get:OneToMany(mappedBy = "id", cascade = [CascadeAction.SAVE, CascadeAction.DELETE])
val explication:Set<Explication>
} }
\ No newline at end of file
...@@ -9,6 +9,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul ...@@ -9,6 +9,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul
import com.biganto.visual.roompark.data.repository.db.IDb import com.biganto.visual.roompark.data.repository.db.IDb
import com.biganto.visual.roompark.data.repository.db.requrey.DbModule import com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import com.biganto.visual.roompark.domain.contract.AuthContract import com.biganto.visual.roompark.domain.contract.AuthContract
import com.biganto.visual.roompark.domain.contract.DealContract
import com.biganto.visual.roompark.domain.contract.DevProgressContract import com.biganto.visual.roompark.domain.contract.DevProgressContract
import com.biganto.visual.roompark.domain.contract.FeedsContract import com.biganto.visual.roompark.domain.contract.FeedsContract
import com.squareup.picasso.Picasso import com.squareup.picasso.Picasso
...@@ -51,6 +52,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{ ...@@ -51,6 +52,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun feedsAlb(): DevProgressContract fun feedsAlb(): DevProgressContract
fun estateRep(): DealContract
fun provideLocal():ILocalStore fun provideLocal():ILocalStore
......
...@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.di.dagger ...@@ -2,6 +2,7 @@ package com.biganto.visual.roompark.di.dagger
import com.biganto.visual.roompark.data.data_provider.AlbumsContractModule import com.biganto.visual.roompark.data.data_provider.AlbumsContractModule
import com.biganto.visual.roompark.data.data_provider.AuthContractModule import com.biganto.visual.roompark.data.data_provider.AuthContractModule
import com.biganto.visual.roompark.data.data_provider.EstateRepository
import com.biganto.visual.roompark.data.data_provider.FeedsContractModule import com.biganto.visual.roompark.data.data_provider.FeedsContractModule
import com.biganto.visual.roompark.data.local.LocalStorage import com.biganto.visual.roompark.data.local.LocalStorage
import com.biganto.visual.roompark.data.repository.api.IRoomParkApi import com.biganto.visual.roompark.data.repository.api.IRoomParkApi
...@@ -11,6 +12,7 @@ import com.biganto.visual.roompark.data.repository.db.IDb ...@@ -11,6 +12,7 @@ import com.biganto.visual.roompark.data.repository.db.IDb
import com.biganto.visual.roompark.data.repository.db.requrey.DbModule import com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import com.biganto.visual.roompark.data.repository.db.requrey.RequeryRepository import com.biganto.visual.roompark.data.repository.db.requrey.RequeryRepository
import com.biganto.visual.roompark.domain.contract.AuthContract import com.biganto.visual.roompark.domain.contract.AuthContract
import com.biganto.visual.roompark.domain.contract.DealContract
import com.biganto.visual.roompark.domain.contract.DevProgressContract import com.biganto.visual.roompark.domain.contract.DevProgressContract
import com.biganto.visual.roompark.domain.contract.FeedsContract import com.biganto.visual.roompark.domain.contract.FeedsContract
import dagger.Binds import dagger.Binds
...@@ -34,6 +36,9 @@ abstract class ContractRepositoryModule { ...@@ -34,6 +36,9 @@ abstract class ContractRepositoryModule {
@Binds @Binds
abstract fun provideDevProgressContract(impl: AlbumsContractModule): DevProgressContract abstract fun provideDevProgressContract(impl: AlbumsContractModule): DevProgressContract
@Binds
abstract fun provideEstateContract(impl: EstateRepository): DealContract
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment