예제 #1
0
 @Override
 public void insert(Logo entity) {
   if (entity.getId() == null) {
     // TODO get new id from sequence
     entity.setId(LogoDao.getInternalId(entity.getPosition()));
   }
   super.insert(entity);
 }
예제 #2
0
 @Override
 protected void fromObject(Logo l, StoreQuery<?> q) {
   // TODO fix it
   // q.addValue(OFC_LOGO.ID, l.getId());
   q.addValue(OFC_LOGO.POS, l.getId());
   // q.addValue(OFC_LOGO.POSITION, l.getPosition().name());
   q.addValue(OFC_LOGO.IMAGE, l.getImage());
   // q.addValue(OFC_LOGO.CONTENT_TYPE, l.getContentType());
 }
예제 #3
0
 @Override
 public void fromRecord(Record r, Logo l) {
   // TODO remove it, get id from db
   Integer id = r.getValue(OFC_LOGO.POS);
   LogoPosition p = LogoDao.getPositionFromId(id);
   l.setId(id);
   l.setPosition(p);
   l.setImage(r.getValue(OFC_LOGO.IMAGE));
   // TODO set contentType
   // l.setContentType(contentType);
 }
예제 #4
0
 @Override
 protected Integer getId(Logo l) {
   return l.getId();
 }
예제 #5
0
 @Override
 protected void setId(Logo l, int id) {
   l.setId(id);
 }
예제 #6
0
 @Override
 protected void fromObject(Logo l, StoreQuery<?> q) {
   q.addValue(OFC_LOGO.POS, l.getPosition());
   q.addValue(OFC_LOGO.IMAGE, l.getImage());
 }
예제 #7
0
 @Override
 public void fromRecord(Record r, Logo l) {
   l.setPosition(r.getValue(OFC_LOGO.POS));
   l.setImage(r.getValue(OFC_LOGO.IMAGE));
 }