-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add log for sending
add works reminder
to profile_event
…
…table
- Loading branch information
1 parent
085f3c8
commit 2d1d09e
Showing
23 changed files
with
158 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
orcid-persistence/src/main/java/org/orcid/persistence/dao/ProfileEventDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.orcid.persistence.dao; | ||
|
||
import org.orcid.persistence.jpa.entities.ProfileEventEntity; | ||
import org.orcid.persistence.jpa.entities.ProfileEventType; | ||
|
||
/** | ||
* | ||
* @author Daniel Palafox | ||
* | ||
*/ | ||
public interface ProfileEventDao extends GenericDao<ProfileEventEntity, Long> { | ||
|
||
boolean isAttemptSend(String orcid, ProfileEventType eventType); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
orcid-persistence/src/main/java/org/orcid/persistence/dao/impl/ProfileEventDaoImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.orcid.persistence.dao.impl; | ||
|
||
import org.orcid.persistence.dao.ProfileEventDao; | ||
import org.orcid.persistence.jpa.entities.ProfileEventEntity; | ||
import org.orcid.persistence.jpa.entities.ProfileEventType; | ||
|
||
import javax.persistence.Query; | ||
import java.math.BigInteger; | ||
import java.util.List; | ||
|
||
/** | ||
* | ||
* @author Daniel Palafox | ||
* | ||
*/ | ||
public class ProfileEventDaoImpl extends GenericDaoImpl<ProfileEventEntity, Long> implements ProfileEventDao { | ||
|
||
public ProfileEventDaoImpl() { super(ProfileEventEntity.class); } | ||
|
||
@Override | ||
public boolean isAttemptSend(String orcid, ProfileEventType eventType) { | ||
Query query = entityManager.createNativeQuery("select count(*) from profile_event where orcid=:orcid and profile_event_type=:eventType"); | ||
query.setParameter("orcid", orcid); | ||
query.setParameter("eventType", eventType.toString()); | ||
Long result = ((BigInteger)query.getSingleResult()).longValue(); | ||
return (result != null && result > 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.