MetaPhrase

An open source translation editor for native mobile app localization.

View project on GitHub

//MetaPhrase/com.github.diegoberaldin.metaphrase.domain.project.persistence.dao/SegmentDao

SegmentDao

interface SegmentDao

Contract for the segment data access object.

Inheritors

 
DefaultSegmentDao

Functions

Name Summary
create [jvm]
abstract suspend fun create(model: SegmentModel, languageId: Int): Int
Create a new segment.
createBatch [jvm]
abstract suspend fun createBatch(models: List<SegmentModel>, languageId: Int)
Create multiple segments in a single transaction.
delete [jvm]
abstract suspend fun delete(model: SegmentModel)
Delete a segment.
getAll [jvm]
abstract suspend fun getAll(languageId: Int): List<SegmentModel>
Get all segments for a language within a project.
getById [jvm]
abstract suspend fun getById(id: Int): SegmentModel?
Get a segment by ID.
getByKey [jvm]
abstract suspend fun getByKey(key: String, languageId: Int): SegmentModel?
Get a segment by key given its language within a project. There can only be at most one segment with a given key for any given language (compound index).
getUntranslatable [jvm]
abstract suspend fun getUntranslatable(languageId: Int): List<SegmentModel>
Get all the untranslatable segments for a language within a project.
search [jvm]
abstract suspend fun search(languageId: Int, baseLanguageId: Int = 0, filter: TranslationUnitTypeFilter = TranslationUnitTypeFilter.ALL, search: String? = null, skip: Int = 0, limit: Int = 0): List<SegmentModel>
Get the list of segments corresponding to some search criteria.
update [jvm]
abstract suspend fun update(model: SegmentModel)
Update a segment.