@Override public void update(Object bean, Transaction t) throws OptimisticLockException { delegate.update(bean, t); }
@Override public int update() { return server.update(this, null); }
@Override public void update(Object bean, Transaction transaction, boolean deleteMissingChildren) throws OptimisticLockException { delegate.update(bean, transaction, deleteMissingChildren); }
/** * Create an Update query to perform a bulk update. * <p> * <pre>{@code * * int rows = Ebean.update(Customer.class) * .set("status", Customer.Status.ACTIVE) * .set("updtime", new Timestamp(System.currentTimeMillis())) * .where() * .gt("id", 1000) * .update(); * * }</pre> * * @param beanType The type of entity bean to update * @param <T> The type of entity bean * @return The update query to use */ public static <T> UpdateQuery<T> update(Class<T> beanType) { return serverMgr.getDefaultServer().update(beanType); }
/** * Force an update using the bean explicitly stating the properties to update. * <p> * If you don't specify explicit properties to use in the update then the * non-null properties are included in the update. * </p> * <p> * For updates against beans that have not been fetched (say built from JSON * or XML) this will treat deleteMissingChildren=true and will delete any * 'missing children'. Refer to * {@link EbeanServer#update(Object, Set, Transaction, boolean, boolean)}. * </p> * * @param bean * The bean holding the values to be included in the update. * @param updateProps * the explicit set of properties to include in the update (can be * null). */ public static void update(Object bean, Set<String> updateProps) { serverMgr.getPrimaryServer().update(bean, updateProps); }
/** * Force an update using the bean explicitly stating the properties * to update. * <p> * If you don't specify explicit properties to use in the update then * the non-null properties are included in the update. * </p> * <p> * For updates against beans that have not been fetched (say built from JSON or * XML) this will treat deleteMissingChildren=true and will delete any * 'missing children'. Refer to {@link EbeanServer#update(Object, Set, Transaction, boolean, boolean)}. * </p> * * @param bean The bean holding the values to be included in the update. * @param updateProps the explicit set of properties to include in the update (can be null). */ public static void update(Object bean, Set<String> updateProps) { serverMgr.getPrimaryServer().update(bean, updateProps); }
serverMgr.getPrimaryServer().update(bean);
serverMgr.getPrimaryServer().update(bean);
/** * update object */ @Override public void update(T t) throws PragmatachException { try { ebeanServer.update(t); } catch (final Exception e) { throw new PragmatachException("Exception in save", e); } } }
/** * Update this entity. * * @see EbeanServer#update(Object) */ public void update() { db().update(this); }
@Override public void save(MODEL_TYPE entity, String fields, Object... values) throws IllegalArgumentException { ebean_(false).update(entity); }
/** * Perform an update using this entity against the specified server. */ public void update(String server) { db(server).update(this); }
/** * Updates this entity, using a specific Ebean server. * * @param server the Ebean server to use */ public void update(String server) { Ebean.getServer(server).update(this); }
public void save(Transaction tx, MODEL_TYPE entity, String fields, Object... values) throws IllegalArgumentException { ebean_(false).update(entity, tx); }
protected void executeDerivedRelationships() { List<DerivedRelationshipData> derivedRelationships = persistRequest.getDerivedRelationships(); if (derivedRelationships != null) { for (int i = 0; i < derivedRelationships.size(); i++) { DerivedRelationshipData derivedRelationshipData = derivedRelationships.get(i); EbeanServer ebeanServer = persistRequest.getEbeanServer(); HashSet<String> updateProps = new HashSet<String>(); updateProps.add(derivedRelationshipData.getLogicalName()); ebeanServer.update(derivedRelationshipData.getBean(), updateProps, transaction, false, true); } } }
/** * Updates this entity, by specifying the entity ID, using a specific Ebean server. * * @param server the Ebean server to use */ public void update(Object id, String server) { _setId(id); Ebean.getServer(server).update(this); }
protected void executeDerivedRelationships() { List<DerivedRelationshipData> derivedRelationships = persistRequest.getDerivedRelationships(); if (derivedRelationships != null) { for (int i = 0; i < derivedRelationships.size(); i++) { DerivedRelationshipData derivedRelationshipData = derivedRelationships.get(i); EbeanServer ebeanServer = persistRequest.getEbeanServer(); HashSet<String> updateProps = new HashSet<String>(); updateProps.add(derivedRelationshipData.getLogicalName()); ebeanServer.update(derivedRelationshipData.getBean(), updateProps, transaction, false, true); } } }
@Override public <T> UpdateQuery<T> update(Class<T> beanType) { methodCalls.add(MethodCall.of(UPDATE).with("beanType", beanType)); return delegate.update(beanType); }
@Override public <T> int update(Query<T> query, Transaction transaction) { methodCalls.add(MethodCall.of(UPDATE).with("query", query).with("transaction", transaction)); if (persistUpdates) { return delegate.update(query, transaction); } return 0; }
@Override public void updateEmployee(Employee employeeToUpdate) { EmployeeEntity entity = new EmployeeEntity(); entity.setPid(employeeToUpdate.getPid()); entity.setEmail(employeeToUpdate.getEmail()); entity.setName(employeeToUpdate.getName()); entity.setSurname(employeeToUpdate.getSurname()); entity.setSalary(employeeToUpdate.getSalary()); entity.setDepartmentPid(employeeToUpdate.getDepartmentPid()); ebean.update(entity); }