dstruct.metadata

DStruct - Object-Relation Mapping for D programming language, with interface similar to Hibernate.

Hibernate documentation can be found here: http://hibernate.org/docs

Source file dstruct/metadata.d.

This module contains implementation of Annotations parsing and ORM model metadata holder classes.

Members

Aliases

enforceHelper
alias enforceHelper = enforceEx

Undocumented in source.

enforceHelper
alias enforceHelper = enforce

Undocumented in source.

Classes

ColumnInfo
class ColumnInfo

Undocumented in source.

DBInfo
class DBInfo

information about DB structure generated from DStruct entity metadata

EntityInfo
class EntityInfo

Metadata of single entity

EntityMetaData
class EntityMetaData

Undocumented in source.

IndexInfo
class IndexInfo

Undocumented in source.

JoinTableInfo
class JoinTableInfo

Undocumented in source.

PropertyInfo
class PropertyInfo

Metadata of entity property

SchemaInfo
class SchemaInfo

Undocumented in source.

SchemaInfoImpl
class SchemaInfoImpl(T...)

Undocumented in source.

TableInfo
class TableInfo

information about table in DB

Enums

IndexType
enum IndexType

Undocumented in source.

PropertyMemberKind
enum PropertyMemberKind

Undocumented in source.

PropertyMemberType
enum PropertyMemberType

Undocumented in source.

RelationType
enum RelationType

Undocumented in source.

Functions

applyDefault
string applyDefault(string s, string defaultValue)

Undocumented in source. Be warned that the author may not have intended to support it.

camelCaseToUnderscoreDelimited
string camelCaseToUnderscoreDelimited(string s)

converts camel case MyEntityName to my_entity_name

capitalizeFieldName
string capitalizeFieldName(string name)

Undocumented in source. Be warned that the author may not have intended to support it.

classNameToPropertyName
string classNameToPropertyName(string name)

lowercases first letter

emptyStringToNull
string emptyStringToNull(string s)

Undocumented in source. Be warned that the author may not have intended to support it.

entityListDef
string entityListDef()

Undocumented in source. Be warned that the author may not have intended to support it.

generateImportFor
string generateImportFor()

Undocumented in source. Be warned that the author may not have intended to support it.

getCollectionPropertyVariantWriteCode
string getCollectionPropertyVariantWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getColumnLength
int getColumnLength()

Undocumented in source. Be warned that the author may not have intended to support it.

getColumnName
string getColumnName()

Undocumented in source. Be warned that the author may not have intended to support it.

getColumnTypeDatasetReadCode
string getColumnTypeDatasetReadCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getColumnTypeDatasetWriteCode
string getColumnTypeDatasetWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getColumnTypeIsNullCode
string getColumnTypeIsNullCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getColumnTypeKeyIsSetCode
string getColumnTypeKeyIsSetCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getColumnTypeName
string getColumnTypeName()

Undocumented in source. Be warned that the author may not have intended to support it.

getEmbeddedPropertyDef
string getEmbeddedPropertyDef()

generate source code for creation of Embedded definition

getEmbeddedPropertyVariantWriteCode
string getEmbeddedPropertyVariantWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getEntityDef
string getEntityDef()

Undocumented in source. Be warned that the author may not have intended to support it.

getEntityName
string getEntityName()

returns entity name for class type

getGeneratorCode
string getGeneratorCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getJoinColumnName
string getJoinColumnName()

Undocumented in source. Be warned that the author may not have intended to support it.

getJoinTableColumn1
string getJoinTableColumn1()

Undocumented in source. Be warned that the author may not have intended to support it.

getJoinTableColumn2
string getJoinTableColumn2()

Undocumented in source. Be warned that the author may not have intended to support it.

getJoinTableName
string getJoinTableName()

Undocumented in source. Be warned that the author may not have intended to support it.

getLazyPropertyLoadedCode
string getLazyPropertyLoadedCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getLazyPropertyObjectWriteCode
string getLazyPropertyObjectWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getManyToManyPropertyDef
string getManyToManyPropertyDef()

generate source code for creation of ManyToMany definition

getManyToOnePropertyDef
string getManyToOnePropertyDef()

generate source code for creation of ManyToOne definition

getOneToManyPropertyDef
string getOneToManyPropertyDef()

generate source code for creation of OneToMany definition

getOneToManyReferencedPropertyName
string getOneToManyReferencedPropertyName()

T is class/entity m is member of T eg T.m; m is a collection/array. The ElementType of the collection/array has a ref to T. Try to figure out the field name in the type of m which is of type T. When m has a attribute of OneToMany with a name, the atribute.name is used.

getOneToOnePropertyDef
string getOneToOnePropertyDef()

generate source code for creation of OneToOne definition

getOneToOneReferencedPropertyName
string getOneToOneReferencedPropertyName()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyCollectionWriteCode
string getPropertyCollectionWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyCopyCode
string getPropertyCopyCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyDef
string getPropertyDef()

creates "new PropertyInfo(...)" code to create property metadata for member m of class T

getPropertyEmbeddedClassName
string getPropertyEmbeddedClassName()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyEmbeddedEntityName
string getPropertyEmbeddedEntityName()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyMemberKind
PropertyMemberKind getPropertyMemberKind()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyMemberType
PropertyMemberType getPropertyMemberType()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyName
string getPropertyName()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyObjectWriteCode
string getPropertyObjectWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyReadCode
string getPropertyReadCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyReferencedClassName
string getPropertyReferencedClassName()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyReferencedEntityName
string getPropertyReferencedEntityName()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyVariantReadCode
string getPropertyVariantReadCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyVariantWriteCode
string getPropertyVariantWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getPropertyWriteCode
string getPropertyWriteCode()

Undocumented in source. Be warned that the author may not have intended to support it.

getSimplePropertyDef
string getSimplePropertyDef()

generate source code for creation of simple property definition

getTableName
string getTableName()

returns table name for class type

getUniqueIndexName
string getUniqueIndexName()

Undocumented in source. Be warned that the author may not have intended to support it.

getterNameToFieldName
string getterNameToFieldName(string name)

Undocumented in source. Be warned that the author may not have intended to support it.

getterNameToSetterName
string getterNameToSetterName(string name)

Undocumented in source. Be warned that the author may not have intended to support it.

hasAnnotation
bool hasAnnotation()

returns true if class has specified anotations

hasAnyKeyPropertyAnnotation
bool hasAnyKeyPropertyAnnotation()

Undocumented in source. Be warned that the author may not have intended to support it.

hasDStructClassOrPropertyAnnotation
bool hasDStructClassOrPropertyAnnotation()

Undocumented in source. Be warned that the author may not have intended to support it.

hasMemberAnnotation
bool hasMemberAnnotation()

returns true if class member has specified anotations

hasOneOfAnnotations
bool hasOneOfAnnotations()

returns true if class has one of specified anotations

hasOneOfMemberAnnotations
bool hasOneOfMemberAnnotations()

returns true if class member has one of specified anotations

hasPercentSign
bool hasPercentSign(string str)

Undocumented in source. Be warned that the author may not have intended to support it.

hasWritePropretyForType
bool hasWritePropretyForType()

returns true if one of overloads of member m of class T is property setter with specified value type

isColumnTypeNullableByDefault
bool isColumnTypeNullableByDefault()

Undocumented in source. Be warned that the author may not have intended to support it.

isGetterFunction
bool isGetterFunction()

Undocumented in source. Be warned that the author may not have intended to support it.

isMainMemberForProperty
bool isMainMemberForProperty()

Undocumented in source. Be warned that the author may not have intended to support it.

isReadWriteProperty
bool isReadWriteProperty()

returns true if member m of class T has both property getter and setter of the same type

percentSignCount
int percentSignCount(string str)

Undocumented in source. Be warned that the author may not have intended to support it.

quoteBool
string quoteBool(bool b)

Undocumented in source. Be warned that the author may not have intended to support it.

quoteString
string quoteString(string s)

Undocumented in source. Be warned that the author may not have intended to support it.

substituteParam
string substituteParam(string fmt, string value)

Undocumented in source. Be warned that the author may not have intended to support it.

substituteParamTwice
string substituteParamTwice(string fmt, string value)

/ string res;/ bool skipNext = false;// foreach(ch; fmt) {/ if (ch == '%') {/ res ~= "1024"; //to!string(value);/ skipNext = true;/ } else if (!skipNext) {/ res ~= ch;/ skipNext = false;/ }/ }/ return res;/ if (hasPercentSign(fmt))/ return format(fmt, value);/ else/ return fmt;

Static variables

ColumnTypeCanHoldNulls
bool[] ColumnTypeCanHoldNulls;

Undocumented in source.

ColumnTypeConstructorCode
string[] ColumnTypeConstructorCode;

Undocumented in source.

ColumnTypeDatasetReaderCode
string[] ColumnTypeDatasetReaderCode;

Undocumented in source.

ColumnTypeIsNullCode
string[] ColumnTypeIsNullCode;

Undocumented in source.

ColumnTypeKeyIsSetCode
string[] ColumnTypeKeyIsSetCode;

Undocumented in source.

ColumnTypePropertyToVariant
string[] ColumnTypePropertyToVariant;

Undocumented in source.

ColumnTypeSetNullCode
string[] ColumnTypeSetNullCode;

Undocumented in source.

ColumnTypeVariantReadCode
string[] ColumnTypeVariantReadCode;

Undocumented in source.

DatasetWriteCode
string[] DatasetWriteCode;

Undocumented in source.

PropertyMemberKind_ReadCode
string[] PropertyMemberKind_ReadCode;

Undocumented in source.

Templates

getLazyCollectionInstanceType
template getLazyCollectionInstanceType(T)

Undocumented in source.

getLazyInstanceType
template getLazyInstanceType(T)

Undocumented in source.

getReferencedInstanceType
template getReferencedInstanceType(T)

Undocumented in source.

hasDStructPropertyAnnotation
template hasDStructPropertyAnnotation(T, string m)

returns true if class member has at least one known property level annotation (@Column, @Id, @Generated)

hasPublicField
template hasPublicField(T : Object, string m)

Undocumented in source.

hasPublicFieldWithAnnotation
template hasPublicFieldWithAnnotation(T : Object, string m)

Undocumented in source.

hasPublicMember
template hasPublicMember(T : Object, string m)

Undocumented in source.

isCollectionMember
template isCollectionMember(T : Object, string m)

member is field or function or property returing SomeClass[] or LazyCollection!SomeClass

isEmbeddedObjectMember
template isEmbeddedObjectMember(T : Object, string m)

returns true if it's object field of Embeddable object type

isLazyCollectionInstance
template isLazyCollectionInstance(T)

Undocumented in source.

isLazyCollectionMember
template isLazyCollectionMember(T : Object, string m)

Undocumented in source.

isLazyInstance
template isLazyInstance(T)

Undocumented in source.

isLazyMember
template isLazyMember(T : Object, string m)

Undocumented in source.

isObject
template isObject(T)

Undocumented in source.

isObjectMember
template isObjectMember(T : Object, string m)

member is field or function or property with SomeClass type

isSupportedSimpleType
template isSupportedSimpleType(T, string m)

Undocumented in source.

isValidGetter
template isValidGetter(T : Object, string m)

Undocumented in source.

isValidGetterWithAnnotation
template isValidGetterWithAnnotation(T : Object, string m)

Undocumented in source.

isValidSetter
template isValidSetter(T : Object, string m, ParamType)

check that member m exists in class T, and it's function with single parameter of type ti

myPackageNamePrefix
template myPackageNamePrefix(alias T)

Undocumented in source.

Meta

Authors

Vadim Lopatin