Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-back
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josue
ejercicio2-framework-back
Commits
b57fda7f
Commit
b57fda7f
authored
Nov 30, 2021
by
Cristian Aguirre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SchedulerTask
parent
8b0856db
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
13 deletions
+21
-13
SchedulerTaskBean.java
src/main/java/com/bytesw/bytebot/bean/SchedulerTaskBean.java
+3
-3
ProcessETL.java
src/main/java/com/bytesw/bytebot/model/ProcessETL.java
+1
-1
SchedulerTask.java
src/main/java/com/bytesw/bytebot/model/SchedulerTask.java
+10
-4
SchedulerTaskService.java
...java/com/bytesw/bytebot/service/SchedulerTaskService.java
+7
-5
No files found.
src/main/java/com/bytesw/bytebot/bean/SchedulerTaskBean.java
View file @
b57fda7f
...
...
@@ -23,9 +23,9 @@ public class SchedulerTaskBean implements Serializable {
@Expose
private
String
stringParameters
;
@Expose
private
String
calendar
;
private
String
calendar
ID
;
@Expose
private
String
calendarName
;
@Expose
private
int
idEtl
;
//
@Expose
//
private int idEtl;
}
src/main/java/com/bytesw/bytebot/model/ProcessETL.java
View file @
b57fda7f
...
...
@@ -9,7 +9,7 @@ import org.hibernate.envers.Audited;
import
javax.persistence.*
;
import
java.io.Serializable
;
@Audited
//
@Audited
@Entity
@Table
(
name
=
"avb_process_etl"
)
@NamedQuery
(
name
=
"ProcessETL.findByPK"
,
query
=
"Select u from ProcessETL u where u.id = ?1"
)
...
...
src/main/java/com/bytesw/bytebot/model/SchedulerTask.java
View file @
b57fda7f
...
...
@@ -5,6 +5,8 @@ import lombok.EqualsAndHashCode;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
org.hibernate.annotations.NotFound
;
import
org.hibernate.annotations.NotFoundAction
;
import
org.hibernate.envers.Audited
;
import
javax.persistence.*
;
...
...
@@ -14,7 +16,7 @@ import java.math.BigInteger;
//@Audited
@Entity
@Table
(
name
=
"AVB_SCHEDULER_TASK"
)
@NamedQuery
(
name
=
"SchedulerTask
s
.findByPK"
,
query
=
"Select u from SchedulerTask u where u.id = ?1"
)
@NamedQuery
(
name
=
"SchedulerTask.findByPK"
,
query
=
"Select u from SchedulerTask u where u.id = ?1"
)
@Getter
@Setter
@EqualsAndHashCode
...
...
@@ -45,15 +47,19 @@ public class SchedulerTask implements Serializable {
@Column
(
name
=
"SHTA_PARAM"
)
private
String
stringParameters
;
@Column
(
name
=
"cale_id"
)
private
String
calendarID
;
@ManyToOne
(
optional
=
false
)
@NotFound
(
action
=
NotFoundAction
.
IGNORE
)
@JoinColumn
(
name
=
"CALE_ID"
,
referencedColumnName
=
"CALE_ID"
,
nullable
=
false
)
private
Calendar
calendar
;
/*@ManyToOne(optional = false)
@JoinColumn(name = "ETL_ID", referencedColumnName = "ETL_ID", nullable = false)
private ProcessETL processETL;*/
@Column
(
name
=
"ETL_ID"
)
private
int
processETL
;
@Column
(
name
=
"etl_id"
)
private
Integer
processETL
;
}
src/main/java/com/bytesw/bytebot/service/SchedulerTaskService.java
View file @
b57fda7f
...
...
@@ -41,7 +41,7 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
if
(
bean
.
getCalendarID
()
==
null
)
{
throw
new
NotFoundException
(
"Calendar can not be null"
);
}
bean
.
setCalendarID
(
bean
.
getCalendarID
().
trim
());
Optional
<
Calendar
>
calendarOptional
=
this
.
calendarRepository
.
findById
(
bean
.
getCalendarID
());
if
(!
calendarOptional
.
isPresent
())
{
throw
new
NotFoundException
(
"Calendar not found "
+
bean
.
getCalendarID
());
...
...
@@ -56,12 +56,14 @@ public class SchedulerTaskService extends XDFService<SchedulerTask, SchedulerTas
SchedulerTaskBean
bean
=
new
SchedulerTaskBean
();
BeanUtils
.
copyProperties
(
model
,
bean
);
bean
.
setInternals
(
model
.
getInternals
().
booleanValue
()
?
"Y"
:
"N"
);
bean
.
setCalendarID
(
bean
.
getCalendarID
().
trim
());
CalendarBean
found
=
this
.
CalendarService
.
getById
(
bean
.
getCalendarID
().
trim
());
if
(
found
!=
null
)
{
bean
.
setCalendarName
(
found
.
getName
());
// CalendarBean found = this.CalendarService.getById(bean.getCalendarID
());
Optional
<
Calendar
>
calendarOptional
=
this
.
calendarRepository
.
findById
(
bean
.
getCalendarID
());
if
(!
calendarOptional
.
isPresent
())
{
throw
new
NotFoundException
(
"Calendar not found "
+
bean
.
getCalendarID
());
}
bean
.
setCalendarName
(
calendarOptional
.
get
().
getName
());
return
bean
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment