gpt4 book ai didi

java - ORMLite 自动生成创建日期

转载 作者:太空宇宙 更新时间:2023-11-04 14:31:31 24 4
gpt4 key购买 nike

我自己使用 long 实现了一个日期,并且我知道我可以通过几种不同的方式保留该日期:

http://ormlite.com/docs/types

有没有办法让ORMLite自动生成对象的创建日期?

最佳答案

I've implemented a date myself using long and I know I can persist the date in a few different ways:

如果我理解这个问题,ORMLite 确实支持使用自定义数据类型持久化器。请参阅有关该主题的文档:

http://ormlite.com/docs/custom-persister

引用:

ORMLite has internal definitions for storing the basic primitive and other common data types. See section Persisted Data Types. Sometimes, however, you either want to store a new data type in your database or you want to change the way ORMLite stores values to the database for common types – this often happens when you are trying to work with an existing schema. You can change how types are stored in the database by defining a class which implements the DataPersister interface.

那里有一些例子。

关于java - ORMLite 自动生成创建日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26087363/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com