Reputation: 51
I saw this code
ContentValues values=new ContentValues();
values.put(CustomerOpenHelper.COLUMN_FIRSTNAME, c.getFirstName());
values.put(CustomerOpenHelper.COLUMN_LASTNAME, c.getLastName());
values.put(CustomerOpenHelper.COLUMN_CITY, c.getCity());
values.put(CustomerOpenHelper.COLUMN_WASTE, c.getWaste());
long insertId=database.insert(CustomerOpenHelper.TABLE_CUSTOMER, null, values);
c.setCustormerId(insertId);
return c;
How can the primitive type "long insertId" contain this objects?
Upvotes: 0
Views: 31
Reputation: 180060
It does not contain the object, it contains the object's ID, which is just a number that identifies the object. In other words, it's a unique number that can be used to look up the row in the table.
Upvotes: 1