/** * Update this entity. * * @see EbeanServer#update(Object) */ public void update() { db().update(this); }
/** * Perform an insert using this entity against the specified server. */ public void insert(String server) { db(server).insert(this); }
/** * Flush any batched changes to the database. * <p> * When using JDBC batch flushing occurs automatically at commit() time or when the batch size * is reached. This provides the ability to manually flush the batch. * </p> */ public void flush() { db().flush(); }
/** * Perform an update using this entity against the specified server. */ public void update(String server) { db(server).update(this); }
/** * Perform a delete using this entity against the specified server. */ public boolean delete(String server) { return db(server).delete(this); }
/** * Insert or update this entity depending on its state. * <p> * Ebean will detect if this is a new bean or a previously fetched bean and perform either an * insert or an update based on that. * * @see EbeanServer#save(Object) */ public void save() { db().save(this); }
/** * Insert this entity. * * @see EbeanServer#insert(Object) */ public void insert() { db().insert(this); }
/** * Delete a bean permanently without soft delete. * <p> * This is used when the bean contains a <code>@SoftDelete</code> property and we * want to perform a hard/permanent delete. * </p> * * @see EbeanServer#deletePermanent(Object) */ public boolean deletePermanent() { return db().deletePermanent(this); }
/** * Refreshes this entity from the database. * * @see EbeanServer#refresh(Object) */ public void refresh() { db().refresh(this); }
/** * Delete this bean. * <p> * This will return true if the bean was deleted successfully or JDBC batch is being used. * </p> * <p> * If there is no current transaction one will be created and committed for * you automatically. * </p> * <p> * If the Bean does not have a version property (or loaded version property) and * the bean does not exist then this returns false indicating that nothing was * deleted. Note that, if JDBC batch mode is used then this always returns true. * </p> * * @see EbeanServer#delete(Object) */ public boolean delete() { return db().delete(this); }
/** * Marks the entity bean as dirty. * <p> * This is used so that when a bean that is otherwise unmodified is updated the version * property is updated. * <p> * An unmodified bean that is saved or updated is normally skipped and this marks the bean as * dirty so that it is not skipped. * <p> * <pre>{@code * * Customer customer = Customer.find.byId(id); * * // mark the bean as dirty so that a save() or update() will * // increment the version property * customer.markAsDirty(); * customer.save(); * * }</pre> * * @see EbeanServer#markAsDirty(Object) */ public void markAsDirty() { db().markAsDirty(this); }
/** * Update this entity. * * @see Database#update(Object) */ public void update() { db().update(this); }
/** * Delete a bean permanently without soft delete. * <p> * This is used when the bean contains a <code>@SoftDelete</code> property and we * want to perform a hard/permanent delete. * </p> * * @see Database#deletePermanent(Object) */ public boolean deletePermanent() { return db().deletePermanent(this); }
/** * Insert this entity. * * @see Database#insert(Object) */ public void insert() { db().insert(this); }
/** * Perform an insert using this entity against the specified server. */ public void insert(String server) { db(server).insert(this); }
/** * Insert or update this entity depending on its state. * <p> * Ebean will detect if this is a new bean or a previously fetched bean and perform either an * insert or an update based on that. * * @see Database#save(Object) */ public void save() { db().save(this); }
/** * Flush any batched changes to the database. * <p> * When using JDBC batch flushing occurs automatically at commit() time or when the batch size * is reached. This provides the ability to manually flush the batch. * </p> */ public void flush() { db().flush(); }
/** * Perform an update using this entity against the specified server. */ public void update(String server) { db(server).update(this); }
/** * Perform a delete using this entity against the specified server. */ public boolean delete(String server) { return db(server).delete(this); }
/** * Refreshes this entity from the database. * * @see Database#refresh(Object) */ public void refresh() { db().refresh(this); }