Creating Custom Object inside class

i have a situation where i have TimePeriod object which consists of two attributes StartDate, EndDate of type DateTime.
i need to use TimePeriod as attribute type in my classes as below
however when I try to synchronize to ERD, VP fails to detect the type of TimePeriod and it sets it to int4.
anyone has done this before or can guide me for the steps.
Thank you.

This actually is a correct behavior since the attributes in class are directly mapped with columns in entity. Since the TimePeriod is a custom data type, the DB engine will not know how to help you persistent this data and therefore it will only map with the default type. If the data in TimePeriod will saved to separate table then I recommend you model this using association instead of attribute. You may also consider to use the ORM User Type feature to model this (but you have to manually implement the persistence logic and type mapping for this class). Details about the use of ORM User Type can be found at How to Use Customized Type in Object Relational Mapping - Visual Paradigm Know-how