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)
Related
I have two classes. One Attribut of class1 is connected to another attribut of class2. This was done with the help of the context menue of the connector in the proximity of one class, it is called Link to element feature. The same is done on the other side of the connector to select the other attribut of the other class. So the connector directly connects two attributes and not the classes itselves. I havenĀ“t found the tables, where this infomation is stored, so I dont find the appropiate SQL to find connected (or not connected) attributes.
Here's the way for notes using Link to..
PDATA1 = 'Attribute'
PDATA2 = t_attribute.ID of the attribute
PDATA3 = name of the attribute
PDATA4 has 'Yes' (I don't recall what that's used for so you can probably ignore it
First SQL:
SELECT PDATA2 FROM t_object WHERE Object_Type='Note' AND PDATA1 = 'Attribute'
will give you the ID. Just put that in another SQL:
SELECT * FROM t_attribute WHERE ID = (above SQL)
and you have the attribute details. Or if you want to find the unmapped one just build a dissection with the found IDs from the first with the existing attribute IDs.
For associations using Link to... it's a bit more tricky. First off, any such connectors have the relevant information stored in t_connector.StyleEx like e.g.
LFEP={69A30E17-23AB-4641-9573-9BDBAA988D52}L;
LF<dir>P=<guid><pos>; connector is attached to attribute/operation
<dir> = S or E meaning Start (source) or End (target) <guid> = ea_guid of t_attribute or t_operation
<pos> is the edge (L or R) where the connector had been attached to in the moment when the link has been created. This is a superfluous information since the renderer will attach the link to whatever place is relevant.
There can be one LFSP, one LFEP or both be present in one StyleEx property
(from my Inside book)
Now you can filter that information with a SQL or (what I prefer) with a little script, since doing complex SQL string operations are not my expertise.
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
I realise many similar questions have been asked but after attempting tens of examples I still cannot get this to work. The problem I am having involves the updating of foreign key values in the Users table.
I am creating a website using ASP WebForms, .net 4.5, Entity Framework 5, SQL server 2012.
I created the EF using database first, here you can see a sample of the model:
I am using a 3 tier architecture - my data access layer queries the database using LINQ and returns a User object (as defined by T4).
This means the object is disconnected from the context when it is modified. (right?)
I modify the object in the page's code behind, updating the UserRole by doing this:
(in page load)
Dim _userAcces As UserLayer = UserLayer.getInstance
mUser = _userAcces.getUserWithCustomerAndRole(_ID)
Dim _rolesAccess As UserRolesLayer = UserRolesLayer.getInstance
mRoles = _rolesAccess.listUserRoles
(on button click)
mUser.UserRole = mRoles.Item(dropDownRole.SelectedIndex)
At this point the mUser object holds the correct (updated) UserRole object. I then pass the mUser object back into my data layer to update the database. The simnplest examples I have seen do this:
Using _context As New SaasPortalContext
_context.Entry(updatedUser).State = EntityState.Modified
_context.SaveChanges()
End Using
I have also tried using:
_context.users.attach
getting the original from the context using _context.users.find(id) and updating the original from the updated User object
getting the dbentityentry object from _context.entry(updatedUser) and setting the property("UserRole").isModified property to true
Using any of these methods I expect the foreign key value for UserRole in the Users table to update to be the ID of a different role in the UserRole table, reflecting the changes in the mUser object, but this does not happen and the value does not change.
What am I doing wrong? Why will the ID not update in the Users table?
Any help would be greatly appreciated
I finally worked out what I was doing wrong, I did not check the box for "include foreign key relationships" when setting up the model, meaning the relationships were not properly defined (I assume).
I am wondering if it is possible to map a named native query on the fly instead of getting back a list of Object[] and then looping through and setting up the object that way. I have a call which I know ill return a massive data set and I want to be able to map it right to my entity. Can I do that or will I have to continue looping through the result set.
Here is what I am doing now...
List<Provider> ObjList = (List<Provider>) emf.createNativeQuery(assembleQuery(organizationIDs, 5)).getResultList();
That is my entity, the List (my entity is the provider). Normally I would just return a List<Object[]>
and then I would loop through that to get back all the objects and set them up as new providers and add them to a list....
//List<Provider> provList = new ArrayList<Provider>();
/*for(Object[] obj: ObjList)
{
provList.add(this.GetProviderFromObj(obj));
}*/
As you can see I commented that section of the code out to try this out. I know you can map named native queries if you put your native query in the entity itself and then call it via createNamedQuery. I would do it that way, but I need to use the IN oracle keyword because I have a list of ID's that I want to check against. It is not just one that is needed. And as we all know, native queruies don't handle the in keyword to well. Any advice?
Sigh, If only the IN keyword was supported well for NamedNativeQueries.
Assuming that Provider is configured as a JPA entity, you should be able to specify the class as the second parameter to your createNativeQuery call. For example:
List<Provider> ObjList = (List<Provider>) emf.createNativeQuery(assembleQuery(organizationIDs, 5), Provider.class).getResultList();
According to the documentation, "At a minimum, your SQL must select the class' primary key columns, discriminator column (if mapped), and version column (also if mapped)."
See the OpenJPA documentation for more details.
I've started switching over a project from hand-written JDBC ORM code to Ebeans. So far it's been great; Ebeans is light and easy to use.
However, I have run into a crippling issue: when retrieving a one-to-many list which should be empty there is actually one element in it. This element looks to be some kind of proxy object which has all null fields, so it breaks code which loops through the collection.
I've included abbreviated definitions here:
#Entity
class Store {
...
#OneToMany(mappedBy="store",cascade=CascadeType.ALL,fetch=FetchType.LAZY)
List<StoreAlbum> storeAlbums = new LinkedList<StoreAlbum>();
}
#Entity
class StoreAlbum {
...
#ManyToOne(optional=false,fetch=FetchType.EAGER)
#JoinColumn(name="store_id",nullable=false)
Store store;
}
The ... are where all the standard getters and setters are. The retrieval code looks like this:
Store s = server.find(Store.class)
.where()
.eq("store_id",4)
.findUnique();
Assert.assertEquals("Sprint",s.getStoreName());
Assert.assertEquals(0, s.getStoreAlbums().size());
The database is known to contain a 'store' row for "Sprint", and the 'store_album' table does not contain any rows for that store.
The JUnit test fails on the second assertion. It finds a list with 1 element in it, which is some kind of broken StoreAlbum object. The debugger shows the object as being of the type "com.lwm.catalogfeed.domain.StoreAlbum$$EntityBean$test#1a5e68a" with null values for all the fields which are declared as nullable=false (and optional=false).
Am I missing something here?
Thought I'd post an update on this... I ended up giving up on EBeans and instead switched the implementation over to use MyBatis. MyBatis is fantastic; the manual is easy to read and thorough. MyBatis does what you expect it to do. I got it up and running in no time.
EBeans didn't appear to detect that the join for the associated collection resulted in a bunch of null ids, but MyBatis handled this scenario cleanly.
I ran into the same issue and was able to solve it by adding an identity column to the secondary table (StoreAlbum). I did not investigate the cause but I suppose Ebean needs a primary key on the table in these kind of situations.