我知道如何在Google BigTable中建表。但我有一个疑问:Google BigTable支持哪些数据类型?
我知道如何在Google BigTable中建表。但我有一个疑问:Google BigTable支持哪些数据类型?
引用使用JPA与App Engine中的类和字段注释部分:
要将Fields of the data class that are to be stored in the datastore must either be of a type that is persisted by default or expliclty declared as persistent. You can find a chart detailing JPA default persistence behavior on the DataNucleus website. To explicitly declare a field as persistent, you give it an
@Basic
annotation:
import java.util.Date; import javax.persistence.Enumerated; import com.google.appengine.api.datastore.ShortBlob; // ... @Basic private ShortBlob data;
The type of a field can be any of the following:
- one of the core types supported by the datastore
- a Collection (such as a
java.util.List<...>
) of values of a core datastore type- an instance or Collection of instances of a
@Entity
class- an embedded class, stored as properties on the entity
Email
和PhoneNumber
定义为数据类型,并使用它们,需创建实体并将它们映射为@OneToOne
或将其设置为@Embeddable
。查找Java支持的低级属性类型的最终方法是使用DataTypeUtil
例如:
if (!DataTypeUtil.isSupportedType(value.getClass())) {
// Convert the value to a supported type.
}
Bigtable可以存储所有类型的对象。它只是一个巨大的键值字典。
请在此处查看使用JDO支持的GAE数据类型列表:
http://code.google.com/appengine/docs/java/datastore/dataclasses.html
并且使用Python:
http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html