Open yukiofera opened 12 years ago
class AndroidPersistenceManager
public long save(Object o) { { ... } Long primaryKey = 0L; String tableName = cache.getTableName(); try { primaryKey = database.insert(tableName, null, values); } catch(SQLException e) { throw new AndOrmPersistenceException(MessageFormat.format(bundle.getString("save_error"), o.getClass().getCanonicalName(), e.getMessage())); } PrimaryKeyProperty primaryKeyProperty = cache.getPk(); if (primaryKeyProperty.isAutoInc()) { if (primaryKeyProperty.getDatabaseFieldType().equals(Integer.class)) { primaryKeyProperty.set(o, primaryKey.intValue()); } else if (primaryKeyProperty.getDatabaseFieldType().equals(Long.class)) { primaryKeyProperty.set(o, primaryKey); } } if (cache.getAfterSaveMethod() != null) { invoke(o, cache.getAfterSaveMethod()).withoutParams(); } return primaryKey; }
Would be interesting to return the primary key value.
[]'s
Can you fork the project and push this feature?
Yes I can. :)
If possible, write the unit test ;)
class AndroidPersistenceManager
Would be interesting to return the primary key value.
[]'s