com.zepben.evolve.database.sqlite.cim.metadata.MetadataCollectionReader.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of evolve-sdk Show documentation
Show all versions of evolve-sdk Show documentation
SDK for interaction with the evolve platform
/*
* Copyright 2024 Zeppelin Bend Pty Ltd
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.zepben.evolve.database.sqlite.cim.metadata
import com.zepben.evolve.database.sqlite.common.BaseCollectionReader
import com.zepben.evolve.database.sqlite.common.BaseDatabaseTables
import com.zepben.evolve.database.sqlite.cim.tables.TableMetadataDataSources
import com.zepben.evolve.services.common.meta.MetadataCollection
import java.sql.Connection
/**
* Class for reading the [MetadataCollection] from the database.
*
* @param metadata The [MetadataCollection] to populate from the database.
* @param databaseTables The tables available in the database.
* @param connection The [Connection] to the database.
*/
class MetadataCollectionReader @JvmOverloads constructor(
metadata: MetadataCollection,
databaseTables: BaseDatabaseTables,
connection: Connection,
private val reader: MetadataEntryReader = MetadataEntryReader(metadata),
) : BaseCollectionReader(databaseTables, connection) {
override fun load(): Boolean =
loadEach(reader::load)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy