前言 通常情况下,数据库存储的是基本类型float,int,String等。但是有时需要存储自定义类型,比如Date,或者我们自定义的类。如果想在数据库中存储这样的值,我们就需要通知Room如何将我们自定义的类型转换为原始类型。 Type Converter @Entity public class Company { @PrimaryKey(autoGenerate = true) private int id; private String name; private