Package com.psddev.dari.db

Examples of com.psddev.dari.db.Database


        if (isUpdating == null) {
            chain.doFilter(request, response);

        } else {
            ToolPageContext page = new ToolPageContext(getServletContext(), request, response);
            Database database = page.getTool().getState().getDatabase();

            try {
                ToolUser user = Query.findById(ToolUser.class, page.param(UUID.class, RemoteWidget.USER_ID_PARAMETER));

                if (user != null) {
View Full Code Here


     */
    public void setObject(Object object) {
        ErrorUtils.errorIfNull(object, "object");

        State newState = State.getInstance(object);
        Database db = newState.getRealDatabase();

        getState().setDatabase(db);
        setObjectType(newState.getType());
        setObjectId(newState.getId());

View Full Code Here

    // Synchronizes the given {@code plugin} with the existing one in the
    // database if it can be found.
    private void synchronizePlugin(Plugin plugin) {
        State pluginState = plugin.getState();
        Database database = getState().getDatabase();

        pluginState.setDatabase(database);

        UUID typeId = pluginState.getTypeId();
        Tool tool = plugin.getTool();
View Full Code Here

            if (!ObjectUtils.equals(objectSiteMod.getOwner(), site)) {
                trash(object, site, user);
                return;
            }

            Database database = objectState.getDatabase();
            UUID objectId = objectState.getId();

            try {
                database.beginWrites();
                database.deleteByQuery(Query.from(Draft.class).where("objectId = ?", objectId));
                database.deleteByQuery(Query.from(History.class).where("objectId = ?", objectId));
                database.deleteByQuery(Query.from(Trash.class).where("objectId = ?", objectId));
                objectState.delete();
                database.commitWrites();
            } finally {
                database.endWrites();
            }
        }
View Full Code Here

TOP

Related Classes of com.psddev.dari.db.Database

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.