File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
src/main/java/io/cos/cas/osf Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 22
33We follow the CalVer (https://calver.org/ ) versioning scheme: YY.MINOR.MICRO.
44
5+ 21.3.0 (07-19-2021)
6+ ===================
7+
8+ Support OSF institution deactivation/reactivation
9+
51021.2.5 (05-18-2021)
611===================
712
Original file line number Diff line number Diff line change @@ -100,23 +100,22 @@ public OsfTotp findOneTotpByOwnerId(final Integer ownerId) {
100100 public OsfInstitution findOneInstitutionById (final String id ) {
101101 try {
102102 final TypedQuery <OsfInstitution > query = entityManager .createQuery (
103- "select i from OsfInstitution i where i.institutionId = :id" ,
103+ "select i from OsfInstitution i where i.institutionId = :id and i.deleted = false and i.dateDeactivated is null " ,
104104 OsfInstitution .class
105105 );
106106 query .setParameter ("id" , id );
107107 return query .getSingleResult ();
108108 } catch (final PersistenceException e ) {
109109 return null ;
110110 }
111-
112111 }
113112
114113 @ Override
115114 public List <OsfInstitution > findAllInstitutions () {
116115 try {
117116 final TypedQuery <OsfInstitution > query = entityManager .createQuery (
118117 "select i from OsfInstitution i "
119- + "where (not i.delegationProtocol = '') and i.deleted = false" ,
118+ + "where (not i.delegationProtocol = '') and i.deleted = false and i.dateDeactivated is null " ,
120119 OsfInstitution .class
121120 );
122121 return query .getResultList ();
Original file line number Diff line number Diff line change 99import javax .persistence .Column ;
1010import javax .persistence .Entity ;
1111import javax .persistence .Table ;
12+ import javax .persistence .Temporal ;
13+ import javax .persistence .TemporalType ;
14+ import java .util .Date ;
1215
1316/**
1417 * This is {@link OsfInstitution}.
@@ -43,6 +46,10 @@ public class OsfInstitution extends AbstractOsfModel {
4346 @ Column (name = "is_deleted" )
4447 private Boolean deleted ;
4548
49+ @ Temporal (TemporalType .TIMESTAMP )
50+ @ Column (name = "deactivated" )
51+ private Date dateDeactivated ;
52+
4653 public DelegationProtocol getDelegationProtocol () {
4754 try {
4855 return DelegationProtocol .getType (delegationProtocol );
You can’t perform that action at this time.
0 commit comments