-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backend updates to saving filter to include any custom entity attributes
- Loading branch information
Showing
5 changed files
with
165 additions
and
0 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
43 changes: 43 additions & 0 deletions
43
...u/internet2/tier/shibboleth/admin/ui/domain/filters/CustomEntityAttributeFilterValue.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,43 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.domain.filters; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
import javax.persistence.UniqueConstraint; | ||
|
||
import org.hibernate.envers.Audited; | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.domain.CustomEntityAttributeDefinition; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
|
||
@Entity(name = "custom_entity_attr_filter_value") | ||
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "filter_id", "custom_entity_attribute_name" }) }) | ||
@Audited | ||
// NOTE: lombok's toString and equals cause an infinite loop somewhere that causes stack overflows, so if we need impls, | ||
// do it manually. Do not replace the Getter and Setter with @Data... | ||
@Getter | ||
@Setter | ||
public class CustomEntityAttributeFilterValue { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
@Column(name = "generated_id") | ||
private Integer id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "filter_id", nullable = false) | ||
EntityAttributesFilter entityAttributesFilter; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "custom_entity_attribute_name", referencedColumnName = "name", nullable = false) | ||
CustomEntityAttributeDefinition customEntityAttributeDefinition; | ||
|
||
@Column(name = "value", nullable = false) | ||
String value; | ||
} |
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
12 changes: 12 additions & 0 deletions
12
...rnet2/tier/shibboleth/admin/ui/repository/CustomEntityAttributeFilterValueRepository.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,12 @@ | ||
package edu.internet2.tier.shibboleth.admin.ui.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import edu.internet2.tier.shibboleth.admin.ui.domain.CustomEntityAttributeDefinition; | ||
import edu.internet2.tier.shibboleth.admin.ui.domain.filters.CustomEntityAttributeFilterValue; | ||
import edu.internet2.tier.shibboleth.admin.ui.domain.filters.EntityAttributesFilter; | ||
|
||
// Not entirely sure this is needed for the core, but it did make validation/unit testing a whole lot easier | ||
public interface CustomEntityAttributeFilterValueRepository extends JpaRepository<CustomEntityAttributeFilterValue, Long> { | ||
CustomEntityAttributeFilterValue findByEntityAttributesFilterAndCustomEntityAttributeDefinition(EntityAttributesFilter eaf , CustomEntityAttributeDefinition cead); | ||
} |
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