org.zeroexchange.dao.resource
Interface ResourceTenderDAO<T extends ResourceTender>

All Superinterfaces:
DAO<Integer,T>, IntegerPKDAO<T>
All Known Subinterfaces:
NeedDAO, SupplyDAO
All Known Implementing Classes:
NeedDAOImpl, ResourceTenderDAOImpl, SupplyDAOImpl

public interface ResourceTenderDAO<T extends ResourceTender>
extends IntegerPKDAO<T>

Author:
black

Method Summary
 T getFirstAcceptedTender(Integer resourceId)
          Returns accepted tender (if any) of the specified type.
 T getFirstAcceptedTender(Integer resourceId, Integer userId)
          Returns accepted tender (if any) owned by the specified user.
 Long getTotalTenders(Resource resource, User excludedUser)
           
 T getUserTender(Integer id, Integer id2)
          Returns the tender for the specified resource and user.
 Long getVisitedTendersCount(Resource resource, User user)
          Returns number of unvisited tenders.
 boolean isUserHasTender(Integer resourceId, Integer currentUserId, Boolean isAccepted)
          Returns true if the user have the tenders for the specified resource.
 void remove(Integer userId, Integer resourceId)
          Removes tender by its user and resource.
 
Methods inherited from interface org.zeroexchange.dao.DAO
getById, removeById, save
 

Method Detail

isUserHasTender

boolean isUserHasTender(Integer resourceId,
                        Integer currentUserId,
                        Boolean isAccepted)
Returns true if the user have the tenders for the specified resource. If isAccepted is not null, the method considers wether tender is accepted.


getFirstAcceptedTender

T getFirstAcceptedTender(Integer resourceId,
                         Integer userId)
Returns accepted tender (if any) owned by the specified user.


getFirstAcceptedTender

T getFirstAcceptedTender(Integer resourceId)
Returns accepted tender (if any) of the specified type.


getUserTender

T getUserTender(Integer id,
                Integer id2)
Returns the tender for the specified resource and user.


remove

void remove(Integer userId,
            Integer resourceId)
Removes tender by its user and resource.


getVisitedTendersCount

Long getVisitedTendersCount(Resource resource,
                            User user)
Returns number of unvisited tenders.

Parameters:
user - TODO

getTotalTenders

Long getTotalTenders(Resource resource,
                     User excludedUser)


Copyright © 2013. All Rights Reserved.