Monday, November 27, 2017

MongoDB nothing but JSON for NoSQL capability

MongoDB nothing but JSON for NoSQL capability

Does it clear for you.

Lets delve deeper for insight.

How does this NoSQL capability is built over,- it is by DescriminatorColumn, DescriminatorValue, InhertianceType

https://docs.oracle.com/javaee/5/api/javax/persistence/DiscriminatorValue.html

 Example:

    @Entity
    @Table(name="CUST")
    @Inheritance(strategy=SINGLE_TABLE)
    @DiscriminatorColumn(name="DISC", discriminatorType=STRING,length=20)
    @DiscriminatorValue("CUSTOMER")
    public class Customer { ... }

    @Entity
    @DiscriminatorValue("VCUSTOMER")
    public class ValuedCustomer extends Customer { ... }