It is a commonly seen phenomenon that type 2 diabetes runs in families. That is why we ask for family history for diabetes when we suspect diabetes in a patient. There are multiple genes along with environmental factors involved in this and the exact pattern of inheritance is unknown.
As for type 1 diabetes there is also thought to be a genetic predisposition, but Type 2 diabetes has a stronger genetic basis.
Fun Fact: If you are a woman with type 1 diabetes and your child was born before you were 25, your child's risk is 1 in 25; if your child was born after you turned 25, your child's risk is 1 in 100.
HLA association is only seen in Type I diabetes and not in Type II.
However, the role of genetics is stronger in Type II as you have 20% of patients having first degree relative affected while the percentage is only 10% in the case of Type I.
The most acceptable theory so far about the development of Type I is autoimmune destruction of the islet cells possible triggered by a virus in a genetically susceptible individuals.
While in Type II it's mainly the metabolic syndrome with obesity and insulin resistance that are playing role in the pathogenesis. Some papers indicated a possible autosomal dominant mode of transmission in Type II patients.