Package org.openbravo.base.structure
Class BaseOBObject
- java.lang.Object
-
- org.openbravo.base.structure.BaseOBObject
-
- All Implemented Interfaces:
Serializable
,BaseOBObjectDef
,OBNotSingleton
,OBProvidable
,DynamicEnabled
,Identifiable
- Direct Known Subclasses:
ABCActivity
,AccountingCombination
,AccountingFact
,AccountingReport
,AccountingRptElement
,AcctCFS
,AcctProcess
,AcctRptGroup
,AcctRptNode
,AcctSchema
,AcctSchemaDefault
,AcctSchemaElement
,AcctSchemaGL
,AcctSchemaProcess
,AcctSchemaTable
,AcctSchemaTableDocType
,ActiveProposal
,Activity
,ActivityToolset
,ADClientAcctDimension
,ADClientModule
,ADClusterService
,ADClusterServiceSettings
,ADCreatefactTemplate
,ADEPInstancePara
,ADMonth
,ADMonthTrl
,ADOrgModule
,Alert
,AlertRecipient
,AlertRule
,AlertRuleTrl
,Amortization
,AmortizationLine
,AmortizationLineAccountingDimension
,Application
,ApprovedVendor
,APRM_Finacc_Trx_Full_Acct_V
,APRM_FinaccTransactionV
,APRM_PaymentProposalPickEdit
,APRM_Reconciliation_v
,APRMPendingPaymentFromInvoice
,Asset
,AssetAccounts
,AssetGroup
,AssetGroupAcct
,Attachment
,AttachmentConfig
,AttachmentMethod
,Attribute
,AttributeInstance
,AttributeSet
,AttributeSetInstance
,AttributeUse
,AttributeValue
,AuditTrail
,AuditTrailRaw
,AuthenticationProvider
,AuxiliaryInput
,Bank
,BankAccount
,BankAccount
,BankAccountAccounts
,BankFileException
,BankFileFormat
,BankStatement
,BankStatementLine
,Brand
,Budget
,BudgetLine
,BusinessPartner
,BusinessPartner
,BusinessPartner
,BusinessPartnerGroup
,BusinessPartnerSet
,BusinessPartnerSetLine
,Calendar
,Callout
,Campaign
,Case
,CashBook
,CashBookAccounts
,CashJournal
,CashJournalLine
,Category
,CategoryAccounts
,CategoryAccounts
,CategoryTrl
,Channel
,Characteristic
,Characteristic
,CharacteristicSubset
,CharacteristicSubsetValue
,CharacteristicTrl
,CharacteristicValue
,CharacteristicValueTrl
,CheckPoint
,CheckPointSet
,CheckPointShift
,City
,Client
,ClientInformation
,ClusterInstance
,Color
,ColorPalette
,Column
,Commission
,CommissionAmount
,CommissionDetail
,CommissionLine
,CommissionRun
,ConditionGoods
,ContactEmailInteraction
,ConversionRate
,ConversionRateDoc
,CostAdjustment
,CostAdjustmentLine
,Costcenter
,CostCenter
,CostcenterEmployee
,CostcenterIC
,CostCenterMachine
,CostcenterVersion
,Costing
,CostingAlgorithm
,CostingRule
,CostingRuleInit
,CostingRuleProductV
,Country
,CountryTrl
,CreatePOLinesPE
,Currency
,CurrencyTrl
,CustomerAccounts
,DataPackage
,DataPoolReport
,DataPoolSelection
,DataSet
,DataSetColumn
,DataSetTable
,DataSource
,DatasourceField
,DatasourceObservabilityConfig
,DebtPayment
,DebtPaymentBalancing
,DebtPaymentBalReplace
,DebtPaymentCancelV
,DebtPaymentGenerateV
,DebtPaymentV
,Dimension
,DimensionMapping
,Discount
,Discount
,DiscountBusinessPartnerSet
,DiscountInvoice
,DiscountScale
,DocumentTemplate
,DocumentType
,DocumentTypeTrl
,DoubtfulDebt
,DoubtfulDebt_ComputedColumns
,DoubtfulDebtMethod
,DoubtfulDebtRun
,DoubtfulDebtV
,DPManagement
,DPManagementLine
,DynamicOBObject
,Element
,Element
,ElementTrl
,ElementValue
,ElementValueOperand
,ElementValueTrl
,EmailInteraction
,EmailServerConfiguration
,EmailTemplate
,EmployeeAccounts
,EmployeeSalaryCategory
,EntityProfile
,ExpenseType
,ExtensionPoints
,ExternalBusinessPartnerConfig
,ExternalBusinessPartnerConfigFilter
,ExternalBusinessPartnerConfigFilterOption
,ExternalBusinessPartnerConfigLocation
,ExternalBusinessPartnerConfigProperty
,ExternalBusinessPartnerConfigPropertyOption
,ExternalPOS
,ExternalPOSCategory
,ExternalPOSProduct
,ExternalSystemData
,Field
,FieldAccess
,FieldGroup
,FieldGroupTrl
,FieldTrl
,FileType
,FIN_BankStatement
,FIN_BankStatementLine
,FIN_FinaccTransaction
,FIN_FinancialAccount
,FIN_FinancialAccount_ComputedColumns
,FIN_FinancialAccountAccounting
,Fin_OrigPaymentSchedule
,FIN_OrigPaymentScheduleDetail
,FIN_Payment
,FIN_Payment_Credit
,FIN_PaymentDetail
,FIN_PaymentDetailV
,FIN_PaymentMethod
,FIN_PaymentPropDetail
,FIN_PaymentPropDetailV
,FIN_PaymentProposal
,FIN_PaymentProposal_ComputedColumns
,FIN_PaymentSchedInvV
,FIN_PaymentSchedOrdV
,FIN_PaymentSchedule
,FIN_PaymentSchedule_ComputedColumns
,FIN_PaymentScheduleDetail
,FIN_PaymentScheduleDetail_ComputedColumns
,FIN_Reconciliation
,FIN_Reconciliation_ComputedColumns
,FIN_ReconciliationLine_v
,FinAccPaymentMethod
,FinAccTransactionAccounting
,Form
,FormAccess
,FormTrl
,FreightCategory
,GCField
,GCSystem
,GCTab
,GLBatch
,GLCategory
,GLCharge
,GLChargeAccounts
,GLItem
,GLItemAccounts
,GLJournal
,GLJournalLine
,GlobalUse
,Greeting
,GreetingTrl
,HeartbeatLog
,HttpExternalSystemData
,Image
,ImportEntry
,ImportEntryArchive
,Incidence
,Incoterms
,IndirectCost
,IndirectCostValue
,InOutLineAccountingDimension
,InternalConsumption
,InternalConsumptionLine
,InternalMovement
,InternalMovementLine
,InvAmtUpdLnInventories
,InventoryAmountUpdate
,InventoryAmountUpdateLine
,InventoryCount
,InventoryCountLine
,InventoryStatus
,InventoryStatusTrl
,Invoice
,InvoiceCandidateV
,InvoiceDiscount
,InvoiceLine
,InvoiceLineAccountingDimension
,InvoiceLineOffer
,InvoiceLineTax
,InvoiceLineV2
,InvoiceSchedule
,InvoiceTax
,InvoiceTaxCashVAT
,InvoiceTaxCashVAT_V
,InvoiceV2
,LandedCost
,LandedCostCost
,LandedCostType
,Language
,LCDistributionAlgorithm
,LCMatched
,LCReceipt
,LCReceiptLineAmt
,List
,ListTrl
,Location
,Location
,Locator
,LocatorHandlingUnitType
,LogCleanUpConfig
,Lot
,LotControl
,Machine
,MachineCost
,MachineType
,MainteanceOrder
,Maintenance
,MaintenanceSchedule
,MatchingAlgorithm
,MaterialTransaction
,MaterialTransaction_ComputedColumns
,MaterialTransactionV
,MeasureGroup
,MeasureShift
,MeasureTime
,MeasureValues
,Menu
,MenuParameter
,MenuTrl
,Message
,MessageTrl
,ModelImplementation
,ModelImplementationMapping
,ModelImplementationParameter
,Module
,ModuleDBPrefix
,ModuleDBPrefixInstall
,ModuleDependency
,ModuleDependencyInst
,ModuleInstall
,ModuleLog
,ModuleMerge
,ModuleTrl
,NamingException
,NavBarComponent
,NavbarRoleaccess
,NonBusinessDay
,Note
,OAuth2AuthenticationProvider
,OBCQL_QueryColumn
,OBCQL_WidgetQuery
,OBUIAPP_ProcessTrl
,OBUIAPPViewImplementation
,OBWCL_StockByWarehouseView
,Operation
,OperationEmployee
,OperationIndirectCost
,OperationMachine
,OperationProduct
,OperationProductAttribute
,Order
,Order_ComputedColumns
,OrderDiscount
,OrderLine
,OrderLineAccountingDimension
,OrderLineOffer
,OrderlineServiceRelation
,OrderLineTax
,OrderReplacement
,OrderTax
,Organization
,OrganizationAcctSchema
,OrganizationClosing
,OrganizationFilter
,OrganizationInformation
,OrganizationLanguage
,OrganizationModuleV
,OrganizationTree
,OrganizationType
,OrgWarehouse
,Parameter
,Parameter
,ParameterTrl
,ParameterValue
,PaymentExecutionHistoryV
,PaymentExecutionProcess
,PaymentExecutionProcessParameter
,PaymentPriority
,PaymentRun
,PaymentRunParameter
,PaymentRunPayment
,PaymentTerm
,PaymentTermLine
,PaymentTermTrl
,Period
,Period_ComputedColumns
,PeriodControl
,PeriodControlLog
,PeriodControlV
,PeriodicControl
,Periodicity
,Planner
,PlanningMethod
,PlanningMethodLine
,POInvoiceMatch
,Preference
,PrereservationManualPickEdit
,PriceAdjustment
,PriceAdjustmentIncompatibility
,PriceList
,PriceList
,PriceListSchema
,PriceListSchemeLine
,PriceListVersion
,PricingAdjustmentAvailability
,PricingAdjustmentBusinessPartnerExtRef
,PricingAdjustmentTrl
,Procedures
,Process
,Process
,ProcessAccess
,ProcessAccess
,ProcessClusterInstanceAccess
,ProcessExecution
,ProcessGroup
,ProcessGroupExecution
,ProcessGroupList
,ProcessInstance
,ProcessParameter
,ProcessParameterTrl
,ProcessPlan
,ProcessPlanTotalizedAux
,ProcessRequest
,ProcessRun
,ProcessScheduling
,ProcessTrl
,Product
,Product
,Product
,ProductAccounts
,ProductAUM
,ProductBOM
,ProductByPriceAndWarehouse
,ProductCategory
,ProductCategory
,ProductCategory
,ProductCategoryTrl
,ProductCharacteristic
,ProductCharacteristic_ComputedColumns
,ProductCharacteristicConf
,ProductCharacteristicDescriptionOrg
,ProductCharacteristicOrg
,ProductCharacteristics
,ProductCharacteristicValue
,ProductCustomer
,ProductionLine
,ProductionPlan
,ProductionRun
,ProductionRunEmployee
,ProductionRunIndirectCosts
,ProductionRunInvoiceLine
,ProductionRunLine
,ProductionRunMachine
,ProductionRunToolset
,ProductionTransaction
,ProductMedia
,ProductOrg
,ProductPrice
,ProductPriceException
,ProductServiceLinked
,ProductStatus
,ProductStatusTrl
,ProductStockView
,ProductSubstitute
,ProductSubtype
,ProductTemplate
,ProductTrl
,ProductUOM
,Project
,ProjectAccounts
,ProjectIssue
,ProjectLine
,ProjectPhase
,ProjectProposal
,ProjectProposalLine
,ProjectProposalTask
,ProjectTask
,ProjectType
,ProjectVendor
,PromissoryFormat
,PromotionType
,PromotionTypeTrl
,Protocol
,PurchasingRun
,PurchasingRunLine
,QuartzBlobTriggers
,QuartzCalendars
,QuartzCronTriggers
,QuartzFiredTriggers
,QuartzJobDetails
,QuartzLocks
,QuartzPausedTriggerGroup
,QuartzSchedulerState
,QuartzSimpleTriggers
,QuartzSimpropTriggers
,QuartzTriggers
,QueryColumnTrl
,ReceiptInvoiceMatch
,Reference
,ReferenceDataStore
,ReferencedInventory
,ReferencedInventory_ComputedColumns
,ReferencedInventoryType
,ReferencedInventoryTypeOrgSequence
,ReferencedMask
,ReferencedTable
,ReferencedTree
,ReferencedTreeField
,ReferenceTrl
,RefWindow
,Region
,RejectReason
,Remittance
,RemittanceLine
,RemittanceParameter
,RemittanceType
,ReportDefinition
,ReprintableDocument
,Requisition
,RequisitionLine
,RequisitionPOMatch
,Reservation
,ReservationStock
,ReservedGoodMovementPickEdit
,Resource
,ResourceAssignment
,ResourceType
,ResourceUnAvailable
,ReturnMaterialReceiptPickEdit
,ReturnMaterialShipmentPickEdit
,ReturnReason
,ReversedInvoice
,Role
,RoleInheritance
,RoleOrganization
,SalaryCategory
,SalaryCategoryCost
,SalesForecast
,SalesForecastLine
,SalesRegion
,Section
,Selector
,Selector
,SelectorColumn
,SelectorField
,SelectorFieldTrl
,SelectorTrl
,Sequence
,SerialNumberControl
,ServicePriceRule
,ServicePriceRuleRange
,ServicePriceRuleVersion
,ServiceProduct
,ServiceProductCategory
,Session
,SessionUsageAudit
,Settlement
,Sheet
,Sheet_ComputedColumns
,SheetLine
,SheetLineV
,ShipmentInOut
,ShipmentInOut_ComputedColumns
,ShipmentInOutLine
,ShippingCompany
,ShippingCompanyFreight
,SOLReservedStock
,SQLScript
,StandardPhase
,StandardTask
,StockAux
,StockProposed
,StockValuation
,StorageDetail
,StoragePending
,System
,SystemInformation
,Tab
,TabAccess
,Table
,TableAccess
,TableNavigation
,TablePostV
,TableTree
,TabTrl
,Task
,TaxCategory
,TaxCategory
,TaxCategoryTrl
,TaxPayment
,TaxRate
,TaxRateAccounts
,TaxRegister
,TaxRegisterline
,TaxRegisterType
,TaxRegisterTypeLines
,TaxReport
,TaxTrl
,TaxZone
,Template
,TemplateDependency
,Test
,TextInterface
,TextInterfaceTrl
,TimeType
,Toolset
,ToolsetType
,TransactionCost
,TransactionLast
,Tree
,TreeNode
,UIPersonalization
,UOM
,UOMConversion
,UOMTrl
,User
,UserDimension1
,UserDimension2
,UserInterfaceDefinition
,UserRoles
,Validation
,Value
,ValuedStockAggregated
,VendorAccounts
,Version
,ViewRoleAccess
,VolumeDiscount
,Warehouse
,WarehouseAccounts
,WarehouseRule
,WarehouseShipper
,WidgetClass
,WidgetClassAccess
,WidgetClassMenu
,WidgetClassMenuTrl
,WidgetClassTrl
,WidgetInstance
,WidgetList
,WidgetReference
,WidgetURL
,Window
,WindowAccess
,WindowTrl
,Withholding
,Withholding
,WithholdingAccounts
,WorkCenter
,WorkCenterMachine
,WorkEffortEmployee
,WorkEffortIncidence
,Worker
,WorkRequirement
,WorkRequirement_ComputedColumns
,WorkRequirementOperation
,WorkRequirementProduct
,Year
,YearClose
public abstract class BaseOBObject extends Object implements BaseOBObjectDef, Identifiable, DynamicEnabled, OBNotSingleton, Serializable
Base business object, the root of the inheritance tree for all business objects. The class model here combines an inheritance structure with interface definitions. The inheritance structure is used to enable some re-use of code. The interfaces are used to tag a certain implementation with the functionality it provides. The outside world should use the interfaces to determine if an object supports specific functionality.- Author:
- mtaal
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseOBObject()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkDerivedReadable(Property p)
Object
get(String propName)
Returns the value of theProperty
identified by the propName.Object
get(String propName, Language language)
Returns the value of theProperty
identified by the propName translating it, if possible, to the language.Object
get(String propName, Language language, String id)
Returns the value of theProperty
identified by the propName translating it, if possible, to the language.Entity
getEntity()
Return the entity of this object.abstract String
getEntityName()
Object
getId()
String
getIdentifier()
Object
getValue(String propName)
Returns the value ofProperty
identified by the propName.boolean
isAllowRead()
boolean
isNewOBObject()
Returns true if the id is null or the object is set to new explicitly.boolean
isOrgClientAccessCheckEnabled()
For internal use only.boolean
isWriteAccessCheckEnabled()
For internal use only.void
set(String propName, Object value)
Set a value for theProperty
identified by the propName.void
setAccessChecks(boolean checkWriteAccess, boolean checkOrgClientAccess)
For internal use only.void
setAllowRead(boolean allowRead)
Sets if the object maybe read also by non-authorized users.protected void
setDefaultValue(String propName, Object value)
void
setId(Object id)
void
setNewOBObject(boolean newOBObject)
void
setValue(String propName, Object value)
Sets a value in the object without any security or validation checking.String
toString()
void
validate()
Validates the content of this object using the property validators.
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public Object getId()
- Specified by:
getId
in interfaceBaseOBObjectDef
- Specified by:
getId
in interfaceIdentifiable
-
setId
public void setId(Object id)
- Specified by:
setId
in interfaceIdentifiable
-
getEntityName
public abstract String getEntityName()
- Specified by:
getEntityName
in interfaceIdentifiable
-
getIdentifier
public String getIdentifier()
- Specified by:
getIdentifier
in interfaceBaseOBObjectDef
- Specified by:
getIdentifier
in interfaceIdentifiable
-
get
public Object get(String propName)
Returns the value of theProperty
identified by the propName. This method does security checking. If a security violation occurs then a OBSecurityException is thrown.- Specified by:
get
in interfaceBaseOBObjectDef
- Specified by:
get
in interfaceDynamicEnabled
- Parameters:
propName
- the name of theProperty
for which the value is requested- Throws:
OBSecurityException
- See Also:
get(String, Language)
-
get
public Object get(String propName, Language language)
Returns the value of theProperty
identified by the propName translating it, if possible, to the language. This method does security checking. If a security violation occurs then a OBSecurityException is thrown.- Parameters:
propName
- the name of theProperty
for which the value is requestedlanguage
- language to translate to- Returns:
- value of the property
- Throws:
OBSecurityException
- in case property is not readable- See Also:
get(String)
-
get
public Object get(String propName, Language language, String id)
Returns the value of theProperty
identified by the propName translating it, if possible, to the language. In case the translated value is not in session, it will look for the same in the object. This method does security checking. If a security violation occurs then a OBSecurityException is thrown.- Parameters:
propName
- the name of theProperty
for which the value is requestedlanguage
- language to translate toid
- uuid of the referenced object- Returns:
- value of the property
- Throws:
OBSecurityException
- in case property is not readable- See Also:
get(String)
-
set
public void set(String propName, Object value)
Set a value for theProperty
identified by the propName. This method checks the correctness of the value and performs security checks.- Specified by:
set
in interfaceBaseOBObjectDef
- Specified by:
set
in interfaceDynamicEnabled
- Parameters:
propName
- the name of theProperty
being setvalue
- the value being set- Throws:
OBSecurityException
- , ValidationException
-
checkDerivedReadable
protected void checkDerivedReadable(Property p)
-
setValue
public void setValue(String propName, Object value)
Sets a value in the object without any security or validation checking. Should be used with care. Is used by the subclasses and system classes.- Parameters:
propName
- the name of theProperty
being setvalue
-
-
getValue
public Object getValue(String propName)
Returns the value ofProperty
identified by the propName. This method does not do security checking.- Parameters:
propName
- the name of the property for which the value is requested.- Returns:
- the value
-
getEntity
public Entity getEntity()
Return the entity of this object. TheEntity
again gives access to theProperties
of this object.- Specified by:
getEntity
in interfaceBaseOBObjectDef
- Returns:
- the Entity of this object
-
validate
public void validate()
Validates the content of this object using the property validators.- Throws:
ValidationException
-
isNewOBObject
public boolean isNewOBObject()
Returns true if the id is null or the object is set to new explicitly. After flushing the object to the database then new object is set to false.- Returns:
- false if the id is set and this is not a new object, true otherwise.
- See Also:
OBInterceptor.postFlush(java.util.Iterator)
-
setNewOBObject
public void setNewOBObject(boolean newOBObject)
-
isAllowRead
public boolean isAllowRead()
-
setAllowRead
public void setAllowRead(boolean allowRead)
Sets if the object maybe read also by non-authorized users. Can only be called in admin mode (seeOBContext.setAdminMode()
.- Parameters:
allowRead
-
-
setAccessChecks
public void setAccessChecks(boolean checkWriteAccess, boolean checkOrgClientAccess)
For internal use only. Used to enable or disable the access checks that are done when invokingSecurityChecker.checkWriteAccess(Object)
.- Parameters:
checkWriteAccess
-true
to enable the write access orfalse
to disable it.checkOrgClientAccess
-true
to enable the org/client check orfalse
to disable it.
-
isWriteAccessCheckEnabled
public boolean isWriteAccessCheckEnabled()
For internal use only.- Returns:
true
if the write access check should be done when flushing the changes of this object or to disable the write access check
-
isOrgClientAccessCheckEnabled
public boolean isOrgClientAccessCheckEnabled()
For internal use only.- Returns:
true
if the org/client access check should be done when flushing the changes of this object orfalse
to disable the org/client check
-
-