Skip to content

Instantly share code, notes, and snippets.

@dubeboy
Last active September 14, 2019 23:07
Show Gist options
  • Save dubeboy/326d13574c4686cad6a53c640bab0e0c to your computer and use it in GitHub Desktop.
Save dubeboy/326d13574c4686cad6a53c640bab0e0c to your computer and use it in GitHub Desktop.
package za.co.dubedivine.groceryapp.model
import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
import javax.persistence.Id
@Entity
data class GroceryItem(var name: String, var isAvailable: Boolean) {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
var id: Long = 0L
constructor(): this ("", false)
}
package za.co.dubedivine.groceryapp.model
import javax.persistence.Entity
import javax.persistence.GeneratedValue
import javax.persistence.GenerationType
import javax.persistence.Id
@Entity
data class GroceryItem(var name: String = "",
var isAvailable: Boolean = false,
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
var id: Long = 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment