Skip to main content

Posts

Showing posts with the label Oracle

Databases - Introduction

Database In the information age (which started in 1940 or so when the US census used the first computer), a database is referred to as a silo of information which has data stored in a particular way. This makes stored data relevant to employees in order to make business decisions. Databases are a specific type of model. Models are any storage repository (server) which stores data whether it is a relational database, object-oriented database, flat or just files. In this article, we confine ourselves to relational databases like MySQL, MS SQLServer20xx, Oracle, Sybase, MS Access and HSQLDB. These are the most common relational databases currently in use. Non-Relational Databases Before we move onto relational databases we will first discuss non-relational ones. These demanded a lot of sort to find code by programmers in order to retrieve the data to the users. Consider the US phone book and the number 307-456-7892. In order to search the phone book to retrieve who is associated to ...

Hibernate-Secondary Table Annotation..

When using Hibernate with annotation, SecondaryTable needs to be used carefully while using the Discriminator. We assume that there is a table called Inventory which is the parent table that has common elements including Id, createDate, modifiedDate, SKU#, and productType. The other tables, which are children of the Inventory table, are TV_Inventory, DVD_inventory etc.. In this example, we consider TV_Inventory which inherits from Inventory (in terms of objects). @Entity @Table(name = "INVENTORY") @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "PRODUCT_TYPE", discriminatorType = DiscriminatorType.STRING, length = 20) @SequenceGenerator(name = "InventorySequence", sequenceName = "INV_SEQ", allocationSize = 1) public abstract class Inventory {  // getters and setters with other annotations for the columns and relevant methods. }   Consider the child object associated with the table TV_INVENTORY. The outli...