KeyAccess- ORM框架

网友投稿 652 2022-10-13 13:14:00

KeyAccess- ORM框架

KeyAccess 是一个轻量级的对象关系映射框架(ORM),利用现有数据库生成对象模型。

示例代码:

// All artistsList artists = Artist.queryObjects(conn);

// Artists with a good ratingList newArtists = Artist.queryObjects(conn, “rating > 4”);

// Get the number of classical albumsint numClassicalAlbums = Album.queryCount(conn, “type = ‘CLASSICAL’ “);

// Load single object by one or more primary keys (vararg)Artist artist = Artist.queryObjectByKey(conn, 294);

// Load all objects, but not into a list: call a callback function for eachobject instead.// This can dramatically reduce memory requirements if you need to process// thousands of objects. There is also a version available where you can// supply a where clause.Artist.queryObjects(conn, new IObjectLoadHandler(){public void onLoad(Object obj){System.out.println(“Artist: “+ ((Artist)obj).getName());}});

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:pfSense高可用(HA)功能介绍
下一篇:【组队赛#5】BNU 4299 God Save the i-th Queen (数组映射)
相关文章