-
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.
Henter grunnbeløp fra database og fjerner kobling til kalkulus
- Loading branch information
Showing
18 changed files
with
115 additions
and
281 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
30 changes: 30 additions & 0 deletions
30
.../domene/src/main/java/no/nav/k9/sak/behandlingslager/grunnbeløp/GrunnbeløpRepository.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,30 @@ | ||
package no.nav.k9.sak.behandlingslager.grunnbeløp; | ||
|
||
import java.util.List; | ||
|
||
import jakarta.enterprise.context.Dependent; | ||
import jakarta.inject.Inject; | ||
import jakarta.persistence.EntityManager; | ||
import jakarta.persistence.TypedQuery; | ||
import no.nav.k9.felles.jpa.HibernateVerktøy; | ||
import no.nav.k9.sak.behandlingslager.fagsak.Fagsak; | ||
import no.nav.k9.sak.domene.typer.tid.DatoIntervallEntitet; | ||
|
||
@Dependent | ||
public class GrunnbeløpRepository { | ||
|
||
private EntityManager entityManager; | ||
|
||
@Inject | ||
public GrunnbeløpRepository(EntityManager entityManager) { | ||
this.entityManager = entityManager; | ||
} | ||
|
||
public List<GrunnbeløpSats> hentGrunnbeløpForPeriode(DatoIntervallEntitet periode) { | ||
TypedQuery<GrunnbeløpSats> query = entityManager.createQuery("from GrunnbeløpSats where periode.fomDato <= :tomDato and periode.tomDato >= :fomDato", GrunnbeløpSats.class); | ||
query.setParameter("fomDato", periode.getFomDato()); // NOSONAR | ||
query.setParameter("tomDato", periode.getTomDato()); // NOSONAR | ||
return query.getResultList(); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...slager/domene/src/main/java/no/nav/k9/sak/behandlingslager/grunnbeløp/GrunnbeløpSats.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,37 @@ | ||
package no.nav.k9.sak.behandlingslager.grunnbeløp; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Embedded; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import no.nav.k9.sak.domene.typer.tid.DatoIntervallEntitet; | ||
|
||
@Entity(name = "GrunnbeløpSats") | ||
@Table(name = "GRUNNBELOP_SATS") | ||
public class GrunnbeløpSats { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GRUNNBELOP_SATS") | ||
private Long id; | ||
|
||
@Embedded | ||
private DatoIntervallEntitet periode; | ||
|
||
@Column(name = "verdi", nullable = false, updatable = false) | ||
private long verdi; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public DatoIntervallEntitet getPeriode() { | ||
return periode; | ||
} | ||
|
||
public long getVerdi() { | ||
return verdi; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
behandlingslager/domene/src/main/resources/META-INF/pu-default.grunnbeløp.orm.xml
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 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<entity-mappings xmlns="https://jakarta.ee/xml/ns/persistence/orm" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence/orm https://jakarta.ee/xml/ns/persistence/orm/orm_3_0.xsd" | ||
version="3.0"> | ||
|
||
<sequence-generator name="SEQ_GRUNNBELOP_SATS" allocation-size="50" sequence-name="SEQ_GRUNNBELOP_SATS" /> | ||
|
||
<entity class="no.nav.k9.sak.behandlingslager.grunnbeløp.GrunnbeløpSats" /> | ||
|
||
|
||
</entity-mappings> |
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
2 changes: 2 additions & 0 deletions
2
domenetjenester/grunnbelop/src/main/java/no/nav/k9/sak/grunnbeløp/Grunnbeløp.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
32 changes: 13 additions & 19 deletions
32
domenetjenester/grunnbelop/src/main/java/no/nav/k9/sak/grunnbeløp/GrunnbeløpTjeneste.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
160 changes: 0 additions & 160 deletions
160
domenetjenester/grunnbelop/src/main/java/no/nav/k9/sak/grunnbeløp/KalkulusRestKlient.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.