public VObjectImpl( String object_serial, String object_login, User owner, HARDWARE inObjectHardware, long object_lastping, Timezone inTimezone, Lang inLang, String object_loc, int object_mode, int object_state, Files inPicture) throws SQLException { this.object_serial = object_serial; this.object_login = object_login; this.object_owner = owner.getId(); this.object_creation = Long.valueOf(CCalendar.getCurrentTimeInSecond()); this.object_hardware = inObjectHardware.getId(); this.object_lastping = object_lastping; this.object_test = 0; this.time_zone = inTimezone.getId(); this.object_loc = object_loc; this.object_mode = object_mode; this.object_state = object_state; this.timeZone = new SingleAssociationNotNull<VObject, Timezone, TimezoneImpl>( this, "time_zone", TimezoneImpl.SPECIFICATION); this.mOwner = new SingleAssociationNotNull<VObject, User, UserImpl>( this, "object_owner", UserImpl.SPECIFICATION); this.mHardware = new SingleAssociationNotNull<VObject, Hardware, HardwareImpl>( this, "object_hardware", HardwareImpl.SPECIFICATION); // Enregistrement init(VObjectImpl.NEW_COLUMNS); final Files theCurrentPicture = (inPicture != null ? inPicture : inObjectHardware.getPictureFile()); new ObjectProfileImpl(this, theCurrentPicture, net.violet.common.StringShop.EMPTY_STRING); new ObjectPreferencesImpl(this, true, false, inLang); this.mProfile = new SingleAssociationNull<VObject, ObjectProfile, ObjectProfileImpl>( this, "object_id", ObjectProfileImpl.SPECIFICATION, ObjectProfileImpl.SPECIFICATION.getPrimaryKey()); this.mPreferences = new SingleAssociationNull<VObject, ObjectPreferences, ObjectPreferencesImpl>( this, "object_id", ObjectPreferencesImpl.SPECIFICATION, ObjectPreferencesImpl.SPECIFICATION.getPrimaryKey()); }
public HARDWARE getHardware() { return HARDWARE.findById(this.mHardware.get(this.object_hardware).getId()); }