Package com.music.model.persistent

Examples of com.music.model.persistent.PieceEvaluation


    }

    @Transactional
    public void evaluate(long pieceId, Long userId, boolean positive, String ip) {
        if (dao.getEvaluation(pieceId, userId, ip) == null) {
            PieceEvaluation evaluation = new PieceEvaluation();
            evaluation.setDateTime(new DateTime());
            if (userId != null) {
                evaluation.setUser(dao.getById(User.class, userId));
            }
            Piece piece = dao.getById(Piece.class, pieceId);
            evaluation.setPiece(piece);
            evaluation.setPositive(positive);
            evaluation.setIp(ip);
            dao.persist(evaluation);

            // not exact due to race condition - a job should count likes every
            // X minutes
            if (positive) {
View Full Code Here

TOP

Related Classes of com.music.model.persistent.PieceEvaluation

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.