Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
Your Cashier
Project
Project
Details
Activity
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
Ahmad Abi Mulya
Your Cashier
Commits
7f659722
Commit
7f659722
authored
Aug 24, 2020
by
Trio Saputra
Committed by
Wahyu Wibowo
Aug 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding entities
parent
0748f39a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
1 deletion
+110
-1
ProductDao.java
...ain/java/com/example/yourcashiertest/daos/ProductDao.java
+1
-0
LocalDatabase.java
.../com/example/yourcashiertest/databases/LocalDatabase.java
+2
-0
Product.java
...in/java/com/example/yourcashiertest/entities/Product.java
+107
-1
No files found.
app/src/main/java/com/example/yourcashiertest/daos/ProductDao.java
View file @
7f659722
package
com
.
example
.
yourcashiertest
.
daos
;
public
interface
ProductDao
{
}
app/src/main/java/com/example/yourcashiertest/databases/LocalDatabase.java
View file @
7f659722
package
com
.
example
.
yourcashiertest
.
databases
;
public
class
LocalDatabase
{
}
app/src/main/java/com/example/yourcashiertest/entities/Product.java
View file @
7f659722
package
com
.
example
.
yourcashiertest
.
entities
;
public
class
Product
{
import
android.os.Parcel
;
import
android.os.Parcelable
;
import
androidx.room.PrimaryKey
;
public
class
Product
implements
Parcelable
{
@PrimaryKey
(
autoGenerate
=
true
)
private
long
id
;
private
long
price
,
quantity
;
private
String
photo
=
""
,
name
=
""
,
description
=
""
,
category
=
""
;
public
Product
(
long
price
,
long
quantity
,
String
photo
,
String
name
,
String
description
,
String
category
)
{
this
.
price
=
price
;
this
.
quantity
=
quantity
;
this
.
photo
=
photo
;
this
.
name
=
name
;
this
.
description
=
description
;
this
.
category
=
category
;
}
protected
Product
(
Parcel
in
)
{
id
=
in
.
readLong
();
price
=
in
.
readLong
();
quantity
=
in
.
readLong
();
photo
=
in
.
readString
();
name
=
in
.
readString
();
description
=
in
.
readString
();
category
=
in
.
readString
();
}
public
static
final
Creator
<
Product
>
CREATOR
=
new
Creator
<
Product
>()
{
@Override
public
Product
createFromParcel
(
Parcel
in
)
{
return
new
Product
(
in
);
}
@Override
public
Product
[]
newArray
(
int
size
)
{
return
new
Product
[
size
];
}
};
public
long
getPrice
()
{
return
price
;
}
public
void
setPrice
(
long
price
)
{
this
.
price
=
price
;
}
public
long
getQuantity
()
{
return
quantity
;
}
public
void
setQuantity
(
long
quantity
)
{
this
.
quantity
=
quantity
;
}
public
String
getPhoto
()
{
return
photo
;
}
public
void
setPhoto
(
String
photo
)
{
this
.
photo
=
photo
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
parcel
,
int
i
)
{
parcel
.
writeLong
(
id
);
parcel
.
writeLong
(
price
);
parcel
.
writeLong
(
quantity
);
parcel
.
writeString
(
photo
);
parcel
.
writeString
(
name
);
parcel
.
writeString
(
description
);
parcel
.
writeString
(
category
);
}
}
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