identifier

How to get Doctrine2 entity identifier without knowing its name

余生颓废 提交于 2020-02-15 07:10:09
问题 I am attempting to create an abstracted getId method on my base Entity class in Symfony2 using Doctrine2 for a database where primary keys are named inconsistently across tables. When inspecting entity objects I see there is a private '_identifier' property that contains the information I am trying to retrieve but I am not sure how to properly access it. I'm assuming there is some simple Doctrine magic similar to: public function getId() { return $this->getIdentifier(); } But I haven't

Postgres ts_vector

为君一笑 提交于 2020-02-08 07:26:04
问题 I am using Seqeulize with Nodejs. My table name is "Users" and it has a column "userName". I have named the ts vectored column userNameVector. In trying to create the column and set the triggers, I keep getting the error "errorMissingColumn". Apparently it is telling me that my column "userName" doesn't exist but I triple checked and it does. The log from the node console is as follows: Executing (default): ALTER TABLE "Users" ADD COLUMN "userNameVector" TSVECTOR Executing (default): UPDATE

Android 10: IMEI no longer available on API 29. Looking for alternatives

白昼怎懂夜的黑 提交于 2020-01-31 07:22:51
问题 Our client's app main feature is heavily relaying on tracking their clients' devices, they offer products that are bound to the specific phone(not its owner). This was possible using the device imei, but with the privacy changes in Android 10, they made it unreachable. (https://developer.android.com/about/versions/10/privacy/changes). Android has a documentation about what identifier to use on specific user cases, but non matches our case since we need it to be unique, constant and bound to

JSF-generated HTML element ID is changing, how to set it to a fixed element ID?

烂漫一生 提交于 2020-01-29 07:14:24
问题 I have a JSF input text component which has an id of search . In the generated HTML output it looks like this j_idt17:search , but the number 17 is changing from time to time. How to make it to stay one? 回答1: Give the JSF component which generated the HTML element with id="j_idt17" a fixed ID. In this particular case, it's likely the HTML input element's parent <form> element which is generated by the JSF <h:form> component. So, this should do: <h:form id="form"> This way the ID of the

JSF-generated HTML element ID is changing, how to set it to a fixed element ID?

社会主义新天地 提交于 2020-01-29 07:13:13
问题 I have a JSF input text component which has an id of search . In the generated HTML output it looks like this j_idt17:search , but the number 17 is changing from time to time. How to make it to stay one? 回答1: Give the JSF component which generated the HTML element with id="j_idt17" a fixed ID. In this particular case, it's likely the HTML input element's parent <form> element which is generated by the JSF <h:form> component. So, this should do: <h:form id="form"> This way the ID of the

Get object with string identifier

a 夏天 提交于 2020-01-22 02:40:08
问题 I need help with getting property of object with String in JS. I have object elements = { element : { date: { day: 'Monday' } } } and i have JS function where input is "element.date.day" . And basically i need to do something like this: function getObjectByStringIdentifier ( stringId ) { return elements[stringId]; } is this possible in JS ? 回答1: You can do something like this var elements = { element: { date: { day: 'Monday' }, example: { abc: 'hii' } } }; function getObjectByStringIdentifier

Heroku PostrgreSQL client doesn't find relations

大城市里の小女人 提交于 2020-01-17 03:09:51
问题 I am using Heroku and his PostgreSQL addon. When I login to pg:psql and do: SELECT table_name FROM information_schema.tables WHERE table_schema='public'; I see all my tables: Users Cities Registrations Which is expected. But when I do: select * from users; Result is : ERROR: relation "users" does not exist LINE 1: select * from users; Does anyone knows what am I doing wrong? 回答1: Classic problem with mixed case identifiers. Try: select * from "Users"; Read the chapter Identifiers and Key

Disable the natively generated identity value feature in grails

穿精又带淫゛_ 提交于 2020-01-16 23:14:44
问题 The following is my Domain class details. class Age { String agetype static constraints = { } } I am using HeidiSQL. I want to drop the id column that is generated automatically.And set primary key as 'agetype'. what I can I do? 回答1: Identifier can be customized easily inside the mapping block, if the default id is not required. class Age { String agetype static mapping = { id name: 'agetype', column: 'AGE_TYPE', // if the column name is AGE_TYPE generator: 'assigned' // Unique String should

Disable the natively generated identity value feature in grails

风流意气都作罢 提交于 2020-01-16 23:14:02
问题 The following is my Domain class details. class Age { String agetype static constraints = { } } I am using HeidiSQL. I want to drop the id column that is generated automatically.And set primary key as 'agetype'. what I can I do? 回答1: Identifier can be customized easily inside the mapping block, if the default id is not required. class Age { String agetype static mapping = { id name: 'agetype', column: 'AGE_TYPE', // if the column name is AGE_TYPE generator: 'assigned' // Unique String should

Invalid identifier error on field created with select statement

孤街醉人 提交于 2020-01-15 11:11:24
问题 Why sql bellow don't work? select a.field1, a.field2, a.field3, (select count(*) from table2 b where b.field1 = a.field1 ) as field4, (select count(*) from table3 b where b.field1 = a.field1 ) as field5, (select count(*) from table4 b where b.field1 = a.field1 ) as field6, from table1 a order by field4 Oracle says: ORA-00904: "field4": invalid identifier 回答1: try to wrap it up select * from ( select a.field1, a.field2, a.field3, (select count(*) from table2 b where b.field1 = a.field1 ) as