Alternative entity representation only to load, query, or (Multiple domain web hosting)

Alternative entity representation only to load, query, or save data in the chosen representation, which is the Entity- Mode.MAP in the previous example. Note that you can t link a map with a POJO instance; the seller reference has to be a HashMap, not an instance of UserPojo. We mentioned that another good use case for logical entity names is the mapping of one POJO to several tables, so let s look at that. Mapping a class several times Imagine that you have several tables with some columns in common. For example, you could have ITEM_AUCTION and ITEM_SALE tables. Usually you map each table to an entity persistent class, ItemAuction and ItemSale respectively. With the help of entity names, you can save work and implement a single persistent class. To map both tables to a single persistent class, use different entity names (and usually different property mappings):

The model.Item persistent class has all the properties you mapped: id, description, initialPrice, and salesPrice. Depending on the entity name you use at runtime, some properties are considered persistent and others transient: Item itemForAuction = new Item(); itemForAuction.setDescription(”An item for auction”); itemForAuction.setInitialPrice( new BigDecimal(99) ); session.save(”ItemAuction”, itemForAuction); Item itemForSale = new Item(); itemForSale.setDescription(”An item for sale”);
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.