-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matt Ramotar <[email protected]>
- Loading branch information
1 parent
adde145
commit 2d7033d
Showing
18 changed files
with
458 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...ilenativefoundation/trails/xplat/lib/repositories/post/impl/extensions/OrderExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.mobilenativefoundation.trails.xplat.lib.repositories.post.impl.extensions | ||
|
||
import org.mobilenativefoundation.trails.xplat.lib.operations.query.Order | ||
|
||
|
||
object OrderExtensions { | ||
fun Order<*>?.toDomain(): org.mobilenativefoundation.trails.xplat.lib.models.query.Order? { | ||
return this?.let { | ||
org.mobilenativefoundation.trails.xplat.lib.models.query.Order( | ||
propertyName = it.property.name, | ||
direction = it.direction, | ||
propertyType = it.propertyType | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...lenativefoundation/trails/xplat/lib/repositories/post/impl/store/database/PostComparer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.mobilenativefoundation.trails.xplat.lib.repositories.post.impl.store.database | ||
|
||
import org.mobilenativefoundation.trails.xplat.lib.models.post.Post | ||
import org.mobilenativefoundation.trails.xplat.lib.operations.query.Order | ||
|
||
interface PostComparer { | ||
fun compare(a: Post.Node, b: Post.Node, order: Order<Post.Node>?): Int | ||
} |
8 changes: 8 additions & 0 deletions
8
.../mobilenativefoundation/trails/xplat/lib/repositories/post/impl/store/database/PostDAO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
package org.mobilenativefoundation.trails.xplat.lib.repositories.post.impl.store.database | ||
|
||
import kotlinx.coroutines.launch | ||
import org.mobilenativefoundation.trails.xplat.lib.db.PostEntity | ||
import org.mobilenativefoundation.trails.xplat.lib.db.TrailsDatabase | ||
import org.mobilenativefoundation.trails.xplat.lib.models.post.Post | ||
import org.mobilenativefoundation.trails.xplat.lib.models.post.PostOutput | ||
import org.mobilenativefoundation.trails.xplat.lib.operations.io.Operation | ||
import org.mobilenativefoundation.trails.xplat.lib.repositories.post.impl.extensions.PostExtensions.asNode | ||
|
||
interface PostDAO { | ||
suspend fun insertOne(entity: PostEntity) | ||
suspend fun insertOneComposite(composite: Post.Composite) | ||
suspend fun findOne(id: Int): PostEntity? | ||
suspend fun findAll(): List<PostEntity> | ||
fun findOneAndAssembleComposite(id: Int): Post.Composite? | ||
} |
8 changes: 8 additions & 0 deletions
8
...undation/trails/xplat/lib/repositories/post/impl/store/database/PostPredicateEvaluator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.mobilenativefoundation.trails.xplat.lib.repositories.post.impl.store.database | ||
|
||
import org.mobilenativefoundation.trails.xplat.lib.models.post.Post | ||
import org.mobilenativefoundation.trails.xplat.lib.operations.query.Predicate | ||
|
||
interface PostPredicateEvaluator { | ||
fun evaluate(predicate: Predicate<Post.Node, *>, item: Post.Node): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.