60 likes | 208 Views
Presentation Tier. Page1. Page1. Page1. TO1. TO2. TO3. Business Tier. E1. E2. createQuery ( SimplePhotoTO . class , " p . name LIKE '2011'"). TOMan. JPA/ Hibernate Query Engine. Query Engine Selector. Some Custom Filter Query Engine. photoFilter = new PhotoFilter ();
E N D
PresentationTier Page1 Page1 Page1 TO1 TO2 TO3 Business Tier E1 E2
createQuery(SimplePhotoTO.class, "p.name LIKE '2011'") TOMan JPA/Hibernate QueryEngine Query Engine Selector SomeCustom FilterQueryEngine photoFilter = newPhotoFilter(); // ... photoFilterinitialization createQuery(SimplePhotoTO.class, photoFilter) TOMan JPA/Hibernate QueryEngine Query Engine Selector SomeCustom FilterQueryEngine
PresentationTier Page1 Page1 Page1 TO1 TO2 TO3 Business Tier E1 E2
@TO(id = "p.id=:photoId", read = "select p.id, p.name, p.description, p.album.name from Photo p", write = "update Photo p set p.name=:photoName, p.description=:photoDescription") • BasicPhotoAlbumTO • <<class>> • @Index(0) photoId • @Index(1) photoName • @Index(2) photoDescription • @Index(3) albumName :BasicPhoto AlbumTO <<instance>> find(BasicPhotoAlbumTO.class, 120) TOMan select p.id, p.name, p.description, p.album.name from Photo p where p.id=:photoId Entity Manager
@TO(id = "p.id=:photoId", read = "select p.id, p.name, p.description, p.album.name from Photo p", write = "update Photo p set p.name=:photoName, p.description=:photoDescription") :BasicPhoto AlbumTO <<instance>> • BasicPhotoAlbumTO • <<class>> • @Index(0) photoId • @Index(1) photoName • @Index(2) photoDescription • @Index(3) albumName update(photoAlbumTO) TOMan update Photo p set p.name=:photoName, p.description=:photoDescription" where p.id=:photoId Entity Manager
@TO(id = "p.id=:photoId", read = "select p.id, p.name, p.description, p.album.name from Photo p", write = "update Photo p set p.name=:photoName, p.description=:photoDescription") • BasicPhotoAlbumTO • <<class>> • @Index(0) photoId • @Index(1) photoName • @Index(2) photoDescription • @Index(3) albumName :BasicPhoto AlbumTO <<instance>> :BasicPhoto AlbumTO <<instance>> :BasicPhoto AlbumTO <<instance>> createQuery(BasicPhotoAlbumTO.class, "p.album.name='holiday2010'"); TOMan createQuery("selectp.id, p.name, p.description, p.album.name from Photo p where p.album.name='holiday2010'"); Entity Manager