How to assign a temporary target datastore of a pre-existing yellow interface as the source table while creating an interface using ODI SDK?
For a simple source table, the code would go as:
OdiDataStore SourceDS = ((IOdiDataStoreFinder)odiInstance.getTransactionalEntityManager().getFinder(OdiDataStore.class)).findByName(table_Name, model_Name);
I've tried getting the interface as an OdiInterface object and using getTargetDataStore() or getUnderlyingTable() on it, but it doesn't work.
Using the OdiInterface object or the Target Datastore both work whith an instance of InterfaceActionAddSourceDatastore.
The 3rd of the 4th constructors are the ones of interest for a temporary datastore as a source.
InterfaceActionAddSourceDataStore(OdiInterface.TargetDataStore pDataStore, DataSet pDataSet, IAliasComputer pAliasComputer, IClauseImporter pClauseImporter, IAutoMappingComputer pAutoMappingComputer)
InterfaceActionAddSourceDataStore(OdiInterface pInterface, DataSet pDataSet, IAliasComputer pAliasComputer, IClauseImporter pClauseImporter, IAutoMappingComputer pAutoMappingComputer)
The performAction method actually does the change.
Related
I have a mapping model problem in CoreData with Xcode 13.4 and Swift 5.
Originally when I created the entities in CoreData, one of them had an attribute that was defined as
street_no String
Once I realized that I meant to define it as an Int64, I went and changed it, deleted all the two class files, regenerated the code, and my app would always crash with the following error:
[error] error:
addPersistentStoreWithType:configuration:URL:options:error: returned
error NSCocoaErrorDomain (134140)
in the AppDelegate function:
lazy var persistentContainer: NSPersistentContainer = {
let container = NSPersistentContainer(name: “Invoice_Gen")
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
return container
}()
If I changed the attribute back to String, everything worked fine.
After much Googling, the long winded solution I found was:
Keep the attribute, street_no, I want to change as it was originally defined (string)
Create a new attribute called, street_no_2, and define it as an Int64
Delete the two class files for the entity containing the attribute
Regenerate the class files for the entity manually from the Editor menu
Clean Project Folder
Build & Run
Delete the original attribute, street_no
Delete the two class files for the entity containing the attribute
Regenerate the class files for the entity manually from the Editor menu
Clean Project Folder
Build & Run
Rename street_no_2 to street_no
Delete the two class files for the entity containing the attribute
Regenerate the class files for the entity manually from the Editor menu
Clean Project Folder
Build & Run
While I am sure the solution above can be shortened, obviously the problem has to do with the mapping model.
Surely there must be a way to just change an attribute's type?
The error comes because of a mismatch between the stored database file, where you have a string, and what you've told Core Data is in there, which is now an Int. You refer to a mapping model problem but it doesn't sound like you've used a mapping model at all, just changed the model definition directly and expected the framework to cope.
If this is an early stage app (i.e you're still developing the first version) just delete the app from the device or simulator and re-run once you've changed the model and class definition files.
If your app is out in the wild and on user devices, and you don't care about keeping the data, you'll need to include some code to delete the database file on startup according to some defaults key that you define.
If you want to keep the data, then you need to create a new model version in the core data model editor, where the type is defined how you like it, and then add migration or mapping rules to define what should happen during the conversion - I don't think there is any automatically inferrable mapping rule to turn any string into an integer.
I have an external list in SharePoint that references a BCDM I created inside visual studio. The entity as an ID that is auto generated in the database, which means it's read-only.
Create and read method works fine, I'm trying to implement the update method. I have set an input parameter that match my entity and I'm getting this error.
Failed to update a list item for this external list based on the Entity(External Content Type) ‘Notification’ in EntityNamespace ‘Namespace’. Details: The TypeDescriptor with name ‘Id’ in the Method ‘Microsoft.SharePoint.BusinessData.MetadataModel.Static.Method’ on Entity (External Content Type) with Name ‘Namespace’ in Namespace ‘Notification’ is marked ‘PreUpdaterField’, but is contained by another TypeDescriptor marked ‘PreUpdaterField’.
I tried every possible combinaison to make this work, make the id type descriptor read only, pre-updater field = true/ false/, updater field = true/false, removing it, adding another parameter outside the entity. NOTHING WORKS !!! Obviously, I'm about to commit a murder as something so simple just turned out to be the biggest waste of time in my programmation history. What can I do to make this works??
This has been resolved and is explained here:
http://www.dotnetmikael.com/2014/02/sharepoint-2013-bcdm-with-visual-studio.html
I'm trying to write a Casacading(v1.2) casade (http://docs.cascading.org/cascading/1.2/userguide/htmlsingle/#N20844) consisting of two flows:
1) The first flow outputs urls to a db table, (in which they are automatically assigned id's via an auto-incrementing id value).
This flow also outputs pairs of urls into a SequenceFile with field names "urlTo", "urlFrom".
2) The second flow reads from both these sources and tries to do a CoGroup on "urlTo" (from the SequenceFile) and "url" (from the db source) to get the db record "id" for each "urlTo".
It then does a CoGroup on "urlFrom" and "url" to get the db record "id" for each "urlFrom".
The two flows work individually - if I call flow.complete() on the first before running the second flow. But if I put the two flows in a cascade object I get the error
cascading.cascade.CascadeException: no loops allowed in cascade, flow: urlLink*url*url, source: JDBCTap{connectionUrl='jdbc:mysql://localhost:3306/mydb', driverClassName='com.mysql.jdbc.Driver', tableDesc=TableDesc{tableName='urls', columnNames=null, columnDefs=null, primaryKeys=null}}, sink: JDBCTap{connectionUrl='jdbc:mysql://localhost:3306/mydb', driverClassName='com.mysql.jdbc.Driver', tableDesc=TableDesc{tableName='url_link', columnNames=[urlLinkFrom, urlLinkTo], columnDefs=[bigint(20), bigint(20)], primaryKeys=[urlLinkFrom, urlLinkTo]}}
on trying to configure the cascade.
I can see it's coming from the addEdgeFor function of the CascadeConnector but I'm not clear on how to resolve this problem.
I've never used Cascade / CascadeConnector before. Is there something I'm missing?
It seems like your some paths for source and sinks are the same.
A Cascade uses the concept of Direct Graphs to build the Cascade itself so if you have a flow source and a sink source pointing to the same location that in essence creates a loop and is disallowed in the concept of Directed Graphs since
it does not go from:
Source Location A to Sink Location B
but instead goes from:
Source Location A to Sink Location A.
"A Tap is not given an explicit name by design. This is so a given Tap instance can be re-used in different {#link Flow}s that may expect a source or sink by a different logical name, but are the same physical resource."
"In general, two instances of the same Tap class must have differing Identifiers (and different #equals)."
It turns out that JDBCTaps generate their identifier from the connection url alone (and do not include the table name). So as I was reading from one table and writing to a different table in the same database it seemed like I was reading from and writing to the same Tap and causing a loop.
As a work-around, I'm going to subclass the JDBCTap and override the getIdentifier() method to include the table name.
I am using the EF in VS2010. I first created a DB and then choose create model from DB.. Then I go and choose Add Code Generation item.. everything looks good so far. Now I added a new table in my DB, I then choose update model from DB. This is still OK. How do I tell VS 2010 to generate a model file for that new table?
I end up deleting everything and and repeating the step over and over for every time I make a change to the database. ANy suggestions?
When you click on Add Code Generation item inside *.edmx it will create two files:
YourModel.Context.tt (produces a strongly typed ObjectContext for the YourModel.edmx)
YourModel.tt (responsible for generating a file for each EntityType and ComplexType in the YourModel.Context.tt)
When you update your *.edmx you just need to right click on YourModel.tt and choose Run Custom Tool.
More info:
Because you're using such approach i would recommend that you move the YourModel.tt file into the separate Class Library project (hold the Shift key and drag and move it)
Modify:
string inputFile = # "YourModel.edmx"; to
string inputFile = # "..\YourNamespaceWhereEdmxIS\YourModel.edmx";
in your YourModel.tt.
Change Custom Tool Namespace for your YourModel.Context.tt in the properties browser to match YourClassLibraryName
Regards.
I just created a GUI using guide in MATLAB for a small project I'm working on. I have amongst other things two text fields for from and to dates. Now I'd like to get rid of them and use a Java date select tool. Of course this is not possible using guide so I need to add them manually.
I've managed to get them to show up by putting this code into my Opening_Fcn,
uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
using UICOMPONENT.
But even though it shows up I can't access the date select's attributes, for example
get(handles.til2)
returns
??? Reference to non-existent field 'til2'.
How can I fix this?
Unless you edit the saved GUI figure, the basic handles structure will not include your new component by default.
One way to access you component is to store the handle via guidata, by adding the following to your opening function:
handles.til2 = uicomponent(handles, 'style','com.jidesoft.combobox.DateChooserPanel','tag','til2');
guidata(hObject,handles)
Functions that need to access the handle need the line
handles = guidata(hObject)
to return the full handles structure that includes the filed til2