-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to specify "requires managed account" for Account Scaffold…
… API (#923)
- Loading branch information
Showing
16 changed files
with
335 additions
and
49 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
24 changes: 24 additions & 0 deletions
24
...ers/gamma/adapter/secondary/jpa/apikey/settings/AccountScaffoldRequiresManagedEntity.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,24 @@ | ||
package it.chalmers.gamma.adapter.secondary.jpa.apikey.settings; | ||
|
||
import it.chalmers.gamma.adapter.secondary.jpa.util.ImmutableEntity; | ||
import jakarta.persistence.*; | ||
import java.util.UUID; | ||
|
||
@Entity | ||
@Table(name = "g_api_key_account_scaffold_requires_managed") | ||
public class AccountScaffoldRequiresManagedEntity | ||
extends ImmutableEntity<AccountScaffoldRequiresManagedPK> { | ||
|
||
@EmbeddedId AccountScaffoldRequiresManagedPK id; | ||
|
||
protected AccountScaffoldRequiresManagedEntity() {} | ||
|
||
protected AccountScaffoldRequiresManagedEntity(UUID settingsId, String type) { | ||
this.id = new AccountScaffoldRequiresManagedPK(settingsId, type); | ||
} | ||
|
||
@Override | ||
public AccountScaffoldRequiresManagedPK getId() { | ||
return this.id; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...ma/adapter/secondary/jpa/apikey/settings/AccountScaffoldRequiresManagedJpaRepository.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,6 @@ | ||
package it.chalmers.gamma.adapter.secondary.jpa.apikey.settings; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface AccountScaffoldRequiresManagedJpaRepository | ||
extends JpaRepository<AccountScaffoldRequiresManagedEntity, AccountScaffoldRequiresManagedPK> {} |
31 changes: 31 additions & 0 deletions
31
...halmers/gamma/adapter/secondary/jpa/apikey/settings/AccountScaffoldRequiresManagedPK.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,31 @@ | ||
package it.chalmers.gamma.adapter.secondary.jpa.apikey.settings; | ||
|
||
import it.chalmers.gamma.adapter.secondary.jpa.util.PKId; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embeddable; | ||
import java.util.UUID; | ||
|
||
@Embeddable | ||
public class AccountScaffoldRequiresManagedPK | ||
extends PKId<AccountScaffoldRequiresManagedPK.RequiresManagedPK> { | ||
|
||
@Column(name = "settings_id", columnDefinition = "uuid") | ||
private UUID settingsId; | ||
|
||
@Column(name = "super_group_type_name") | ||
private String type; | ||
|
||
@Override | ||
public RequiresManagedPK getValue() { | ||
return new RequiresManagedPK(this.settingsId, this.type); | ||
} | ||
|
||
protected AccountScaffoldRequiresManagedPK() {} | ||
|
||
protected AccountScaffoldRequiresManagedPK(UUID settingsId, String type) { | ||
this.settingsId = settingsId; | ||
this.type = type; | ||
} | ||
|
||
public record RequiresManagedPK(UUID settingsId, String type) {} | ||
} |
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.