Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
query_engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aleksander Vegsund
query_engine
Commits
22d44446
Commit
22d44446
authored
2 years ago
by
Odin Velle Ulvestad
Browse files
Options
Downloads
Plain Diff
Merge branch 'scan_dev' into 'develop'
refactor scan class See merge request
!58
parents
52afb827
107b5608
No related branches found
No related tags found
2 merge requests
!71
Added invoices test data
,
!58
refactor scan class
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/ntnu/queryeng/entity/Scan.java
+12
-16
12 additions, 16 deletions
src/main/java/no/ntnu/queryeng/entity/Scan.java
with
12 additions
and
16 deletions
src/main/java/no/ntnu/queryeng/entity/Scan.java
+
12
−
16
View file @
22d44446
...
...
@@ -19,8 +19,9 @@ public class Scan {
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
int
id
;
@Column
(
name
=
"parcel_id"
,
insertable
=
false
,
updatable
=
false
)
private
int
parcelId
;
@ManyToOne
@Column
(
name
=
"parcel_id"
)
private
Parcel
parcel
;
@ManyToOne
@JoinColumn
(
name
=
"terminal_id"
)
...
...
@@ -33,26 +34,24 @@ public class Scan {
@Column
(
name
=
"scanned_at"
)
private
LocalDateTime
scannedAt
;
@ManyToOne
@JoinColumn
(
name
=
"parcel_id"
)
private
Parcel
parcel
;
/**
* Constructs an instance of this class
*
* @param id unique id of this particular scan
* @param parcel
Id
the parcel that is scanned
* @param terminal
Id
the terminal
id
where the scan is executed
* @param status
Id
the status of the given parcel
* @param parcel the parcel that is scanned
* @param terminal the terminal where the scan is executed
* @param status the status of the given parcel
* @param scannedAt the date and time the scan was executed
*/
public
Scan
(
int
id
,
int
parcel
Id
,
int
terminal
Id
,
int
status
Id
,
LocalDateTime
scannedAt
,
Parcel
parcel
)
{
public
Scan
(
int
id
,
Parcel
parcel
,
Terminal
terminal
,
Status
status
,
LocalDateTime
scannedAt
)
{
if
(
checkId
(
id
))
{
// TODO: add checks for other parameters as well
this
.
id
=
id
;
this
.
parcelId
=
parcelId
;
this
.
scannedAt
=
scannedAt
;
this
.
parcel
=
parcel
;
this
.
terminal
=
terminal
;
this
.
status
=
status
;
this
.
scannedAt
=
scannedAt
;
}
else
{
throw
new
IllegalArgumentException
(
"one or more parameters have an invalid value"
);
}
...
...
@@ -72,8 +71,8 @@ public class Scan {
return
id
;
}
public
int
getParcel
Id
()
{
return
parcel
Id
;
public
Parcel
getParcel
()
{
return
this
.
parcel
;
}
public
Terminal
getTerminal
()
{
...
...
@@ -88,9 +87,6 @@ public class Scan {
return
scannedAt
;
}
public
Parcel
getParcel
()
{
return
parcel
;
}
/**
* Returns true if id has legal value, and false otherwise
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment