write data class used in database