コード例 #1
0
 /* (non-Javadoc)
  * @see mylife.persistence.repository.ActivityLabelRepository#create(java.lang.String)
  */
 @Override
 public ActivityLabel create(String label) {
   ActivityLabel actLabel = new ActivityLabel();
   actLabel.setLabel(label);
   getEntityManager().persist(actLabel);
   return actLabel;
 }
コード例 #2
0
 @Override
 public void save(ActivityLabel label) {
   if (label.getKey() == null) {
     throw new RepositoryException("The entity has not been previously persisted");
   }
   super.merge(label);
 }