public Picture execute(CommandContext commandContext) { ensureNotNull("userId", userId); IdentityInfoEntity pictureInfo = commandContext.getIdentityInfoManager() .findUserInfoByUserIdAndKey(userId, "picture"); if (pictureInfo != null) { String pictureByteArrayId = pictureInfo.getValue(); if (pictureByteArrayId != null) { ByteArrayEntity byteArray = commandContext.getDbEntityManager() .selectById(ByteArrayEntity.class, pictureByteArrayId); return new Picture(byteArray.getBytes(), byteArray.getName()); } } return null; }
public Picture execute(CommandContext commandContext) { ensureNotNull("userId", userId); IdentityInfoEntity pictureInfo = commandContext.getIdentityInfoManager() .findUserInfoByUserIdAndKey(userId, "picture"); if (pictureInfo != null) { String pictureByteArrayId = pictureInfo.getValue(); if (pictureByteArrayId != null) { ByteArrayEntity byteArray = commandContext.getDbEntityManager() .selectById(ByteArrayEntity.class, pictureByteArrayId); return new Picture(byteArray.getBytes(), byteArray.getName()); } } return null; }
public Picture execute(CommandContext commandContext) { ensureNotNull("userId", userId); IdentityInfoEntity pictureInfo = commandContext.getIdentityInfoManager() .findUserInfoByUserIdAndKey(userId, "picture"); if (pictureInfo != null) { String pictureByteArrayId = pictureInfo.getValue(); if (pictureByteArrayId != null) { ByteArrayEntity byteArray = commandContext.getDbEntityManager() .selectById(ByteArrayEntity.class, pictureByteArrayId); return new Picture(byteArray.getBytes(), byteArray.getName()); } } return null; }