Hector API - Create Column Family - key validation class - api

Hey guys I am trying to load a schema into a Cassandra 0.8.2 database via Hector.
I want to add a column family (in a particular keyspace) & specify its name, comparator type, key validation class, and default validation class via Hector.
I've looked through the documentation here:
https://github.com/rantav/hector/blob/master/core/src/main/java/me/prettyprint/hector/api/factory/HFactory.java
for the function that to do this, but it seems I must have the Column Family already created (via the Cassandra CLI) to specify the default validation class, & key validation class when creating the Column Family via the CLI. Am I correct in this assumption? Am I missing any methods? Is it possible to alter the default validation class & key validation class of a Cassandra column family via Hector?

You can do that with hector. There is an example in CassandraClusterTest where you can see new column families being created with the validation class set. There are methods on BasicColumnFamilyDefinition to set the key validation class and comparator as well.

Related

grpc-java, available field names for the method:ManagedChannelBuilder.defaultServiceConfig()

Class : ManagedChannelBuilder
Method : defaultServiceConfig(Map<String,?> serviceConfig)
Available field names : MethodConfig, retryPolicy etc...
https://grpc.github.io/grpc-java/javadoc/io/grpc/ManagedChannelBuilder.html#defaultServiceConfig-java.util.Map-
I am trying to create a parameter for the method but cannot find the available field names. I need a list of the field names for the serviceConfig.
Where can I find the list or do I need to look into the source code to find them out?
Service config definition is defined in this proto.
Service config object (Map<String, Object>) is a JSON like representation of the ServiceConfig protobuf. Note that field names in the map should be in lower camel case.

Change column name for non-primitive field (navigation) with EF Core

Given the following classes:
public class Mission
{
private MissionCard _missionCard;
}
public class MissionCard
{
}
I would like to create this relationship via Fluent API so that _missionCard is treated as a relationship and can be populated from DB but isn't available as a property on my Mission model.
I can create that relationship with:
modelBuilder.Entity<Mission>().HasOne<MissionCard>("_missionCard");
but by default this creates a FK column named "_missionCard". The docs show that a custom name can be specified when using .Property("property name").FromField("field name") but you cannot use .Property for non-primitive types.
Is it possible to change the column name for a relationship like above?
Managed to resolve this by inverting the relationship:
modelBuilder.Entity<MissionCard>()
.HasMany<Mission>()
.WithOne("_missionCard")
.HasForeignKey(nameof(MissionCard));

What does the field h_flags indicate in wynsure tables

I was of the impression that the field h_flags is used in Wynsure tables to indicate that a particular object is locked. Now, I see that the field h_flags is being used in some of the reporting queries and not sure of the correct purpose of it. Also couldn't find much documentation around it in the eWAM help. Can someone please help understand this?
There area a number of technical fields eWAM's Persistancy engine that are hidden or appear differently in eWAM. Here is the list of fields as they look from outside of ewam (MSSQL or Oracle, DB2...)
related link:
https://mphasiswyde.atlassian.net/wiki/display/TT/eWAM+Databases
NSID Name Space ID (representation of the class in the database)
ID ID number of instance, like a serial #
Version Technical Version of the Instance
H_CLID used principaly to know the class to instanciate when loading the object as long as several classes are stored in same table. It is used also for OQL
H_CLVER class version : to know the exact class version of the object
H_THREFCount
H_REFCOUNT handles the integry relashionship at the version level (nb of objects that references this version with a refto/listof integral)
H_UPDATEDATE date when the object is stored :there is Wam API to get these values
H_UPDATETIME time when the object is stored :there is Wam API to get these values
H_ISCURVERS shows that the row is corresponding to the current version of an object (this column does not exist when the object is mono versioned)
H_ISKILLED applicative deletion (eWam API : KillThing())
H_FLAGS technical flags that handles : freezing, referential integrity and cascade deletion
LASTUSER_NSID Key Fields to the Last application User who Modified the object.
LASTUSER_ID "
LASTUSER_VERSION " Note that -1 denotes that the RefTo points at the latest version, not to a specific version
MIGRATIONDATE Marked by wMigrate
NAME THE "Name" variable from aWFUserSignedItem
MYOWNER_NSID Key Fields to a given referenced object (refto)
MYOWNER_ID "
MYOWNER_VERSION "
CREATIONDATE time stamp of the object's Create Date (the time will be null)
CREATIONTIME time stamp of the object's Creation Time, (the date will be saved as well)

Control AIF document service schema

On Dynamics AX 2012 R3 CU8 when you use the wizard to create a document service, the system generates the schema for the different operations in the service. Is there a way to control what gets generated?
For example, if I create a query with HcmWorker as the parent and DirPerson as the child with just a few fields that I'm interested in, the system generates the schema with a few things I don't like, out of which I'll mention a couple below:
It adds fields like AxdEntity_DirPerson_DirParty.Name even though I explicitly didn't include this field in the query
The minOccurs on this field is 1, which doesn't work because it is a computed field. I prefer that this field is not included. If that is not possible, at least I would like to have minOccurs = 0
To make matters even more intriguing, the standard service (HcmWorkerImportService) for importing workers has the minOccurs = 0 for the Name field.
I'm trying to figure out how to control these values.
Have a look into the initMandatoryFieldsMap method from the AxdBase class and overwrite it if needed in your HcmWorkerImportService.
The initMandatoryFieldsMap method specifies which fields are mandatory
in the XML that the document class sends or receives. This method is
used to specify mandatory fields for the document without specifying
them at the table level.
See: MSDN: Walkthrough: Creating a Service Using the AIF Document Service Wizard ("To override the initMandatoryFieldsMap method")
Example:
protected void initMandatoryFieldsMap()
{
super();
this.setParmMethodAsMandatory(classnum(AxdSalesOrder),
methodstr(AxdBase,parmDocPurpose));
}
See: AxdBase.initMandatoryFieldsMap Method

Entity Framework 4.1 Dynamically retrieve mapped column name

I am trying to construct an SQL statement dynamically.
My context is created dynamically, using reflection finding classes deriving from EntityTypeConfiguration and adding them to DbModelBuilder.Configuration.
My EntityTypeConfiguration classes specify HasColumnName to map the Entity property name to db table column name, which I need to construct my SQL statement.
namespace MyDomain {
public class TestEntityConfig : EntityTypeConfiguration<TestEntity>{
Property("Name").HasColumnName("dbName");
}
}
From What I have researched, it seems I can get access to this information through MetadataWorkspace, which I can get to through ObjectContext.
I have managed to retrieve the the entity I am interested in with MetadataWorkspace.GetItem("MyDomain.TestEntity",DataSpace.OSpace), which gives me access to Properties, but none of the properties, of Properties, give me the name of the mapped db column, as specified with HasColumnName.
Also I am not clear what DataSpace.OSpace is and why my model is constructed in this space.
If Anyone can shed some light on this I would be grateful
UPDATE
Further to #Ladislav's comments. I discovered I can get the information as follows
For the class properties
ctx.MetadataWorkspace.GetItem<ClrEntityType>("MyDomain.TestEntity", DataSpace.OSpace)).Members
For the table properties
ctx.MetadataWorkspace.GetItem<EntityType>("CodeFirstDatabaseSchema.TestEntity",SSpace).Members
So given that I only know the type MyDomain.TestEntity and Memeber "Name". How would I go about to get "dbName". Can I always assume that my mapped class will be created in CodeFirstDatabaseSchema, om order to dynamically construct the identity to retrieve it from SSpace and how would I get to the correct Member in SSpace. Can I do something like
var memIndex = ctx.MetadataWorkspace.GetItem<ClrEntityType>("MyDomain.TestEntity", DataSpace.OSpace)).Members["Name"].Index;
var dbName = ctx.MetadataWorkspace.GetItem<EntityType>("CodeFirstDatabaseSchema.TestEntity",SSpace).Members[memIndex];
MetadataWorkspace contanis several containers specified by DataSpace. Interesting for you are:
CSpace - description of conceptual model (this should contain properties)
CSSpace - mapping of conceptual model to storage model (this should contain how classes / properties are mapped to tables / columns)