Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Is there a sample code that shows how to store and retrieve List fields?
just create a class with, for example, a List. Example:
public class Order{ ... List items; ... }
Then:
ODatabaseObjectTx db = new ODatabaseObjectTx("local:/temp/db"); db.create(); db.getEntityManager().registerEntityClass(Order.class); db.getEntityManager().registerEntityClass(OrderItem.class); Order o = new Order(234); o.items = new ArrayList<OrderItem>(); o.items.add( new OrderItem('mouse', 10, 12.5) ); db.save( o );
只需创建一个类,例如,一个列表。例子:
public class Order{ ... 列出项目;... }
然后: